ユーザーがクリックしてサインインする前にあったページにリダイレクトするために、Devise after_sign_in_path を定義する方法は? 私はapplication_controllerでこれを試しました:
13 def after_sign_in_path_for(resource_or_scope)
14 sign_in_url = url_for(:action => 'new', :controller => 'my_sessions', :only_path => false, :protocol => 'http')
15 if request.referer == sign_in_url
16 super
17 else
18 stored_location_for(resource_or_scope) || request.referer || root_path
19 end
20 end
これにより、root_path にのみリダイレクトされます。Sessions calle MySessionsController 用のカスタムコントローラーがあることは言及する価値があります。私は何を間違っていますか?