如何定义Devise after_sign_in_path以重定向到页面用户,然后单击登录?我已经在application_controller中尝试了这一点:使用自定义会话控制器设计after_sign_in_path
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 callse MySessionsController的自定义控制器。我究竟做错了什么?
你能说出'if'语句正在执行哪个分支吗? – rossta 2013-02-11 14:04:55