overriding devise after_sign_up_path_for not working

后端 未结 7 1485
刺人心
刺人心 2020-12-15 17:48

In routes i have the root-path pointing \"home#index\" but when i try to override that with after_sign_up_path_for keeps redirecting me to the root path when I

7条回答
  •  醉酒成梦
    2020-12-15 18:22

    I struggled with this problem until realizing I had forgotten to declare that I was overriding devise's registrations controller. In my case, I'm using devise with the :user resource, so I added this to routes.rb:

    devise_for :users, :controllers => {:registrations => "registrations"}
    

    After that, the redirect that I specified in after_inactive_sign_up_path_for worked.

    Override devise registrations controller has a more complete discussion on this topic, with alternative ways of declaring overrides.

提交回复
热议问题