0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ログアウト後の遷移先を状況に応じて変更

0
Posted at

ApplicationContoroller に以下のような private メソッドを追加、戻り値として遷移先のpathを返す。

app/controllers/application_controller.rb

  # scope が :admin_user の場合は admin_user のログイン画面に遷移
  def after_sign_out_path_for(resource_or_scope)
    return new_admin_user_session_path if resource_or_scope == :admin_user
    root_path
  end

参考

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?