我正在使用可确认的设计。我遇到了一个问题,如果用户多次单击确认链接(即,如果用户忘记了他们已经确认或其他什么),他们会收到一个令人讨厌的错误:
NoMethodError at /confirmation
undefined method `new_user_registration_path' for <ActionDispatch::Routing::RoutesProxy:0x007fe739a40510>
这是确认链接:
<%= link_to 'Confirm my account', confirmation_url(@user, host: @host, confirmation_token: @user.confirmation_token) %>
理想的行为是 flash[:alert] = "You've already Confirm" + 重定向到登录页面。
我尝试创建自己confirmations_controller.rb
的路线并弄乱路线,但没有任何成功。
提前感谢您的任何帮助!