使用Devise时,user
应在登录edit_user_registration_path
后将其重定向到Devise控制器registrations#edit
操作的。
在routes.rb
该根被设定为root :to => 'main#welcome'
。即使已经登录,用户仍将重定向到此页面。
非常感谢Fabrizio
也许您正在寻找的是一种在用户登录后将其重定向到某个地方的方法。应该这样做。将其app/controllers/application_controller.rb
放置在您要带给用户的路径中
def after_sign_in_path_for(resource)
edit_user_registration_path # or any other path needed
end
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句