0
0

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 1 year has passed since last update.

deviseの遷移先の指定はどうするか

Posted at

application_controller.rbへ記述する

def after_sign_in_path_for(resource)
  user_path  // ユーザー詳細画面に遷移
end

def after_sign_up_path_for(resource)
  user_path  // ユーザー詳細画面に遷移
end

def after_sign_out_path_for(resource)
  new_user_session_path  // ログイン画面に遷移
end

application_controller.rbに上記のような記述をするだけで、deviseで新規登録した後の遷移先、ログインした後の遷移先、ログアウトした後の遷移先を指定できる。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?