Not able to route using after_inactive_sign_up_path_for

微笑、不失礼 提交于 2019-12-25 01:44:59

问题


I overridden RegistrationController my_devise/Registration controller i overridden the following methos:

def after_inactive_sign_up_path_for(resource) awaiting_confirmation_path

end

I also have a new method in my RegistrationController named: def awaiting_confirmation(resource) do tuff....
end

My routing file looks likethis:

devise_for :accounts, :controllers => { :registrations => "my_devise/registrations"}

resources :registration do match "awaiting_confirmation" => "registrations#awaiting_confirmation" end

I get an error message: No route matches {:action=>"awaiting_confirmation", :controller=>"registrations"}

What am i doing wrong?


回答1:


resources :registration do
match "awaiting_confirmation" => "registrations#awaiting_confirmation"
end

Where are you specifying that your registrations controller is in my_devise folder??
You need to specify that manually, because Rails follows conventions, and therefore its looking in the app/controllers directory to find the registrations controller, that you have written yourself.
To get more idea about this, have a look at the output of rake routes command and find the route that rails has generated for it.



来源:https://stackoverflow.com/questions/8633011/not-able-to-route-using-after-inactive-sign-up-path-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!