やりたい時に忘れるからメモ
- plataformatec/devise · GitHub
- Home · plataformatec/devise Wiki · GitHub
- http://kosuke-komiya.info/wiki/index.php?RubyOnRails_DeviseTutorialListJa
サインアウト後のリダイレクト先を指定
for exsample
app/controllers/application_controller.rb
class ApplicationController < ActionController::Base private # Overwriting the sign_out redirect path method def after_sign_out_path_for(resource_or_scope) root_path end end
サインイン後のリダイレクト先を指定
How To: redirect to a specific page on successful sign in · plataformatec/devise Wiki · GitHub
for exsample
app/controllers/application_controller.rb
class ApplicationController < ActionController::Base protect_from_forgery def after_sign_in_path_for(resource) admin_path end end