简体   繁体   English

覆盖设计路线适用于会议,但不适用于注册

[英]overriding devise routes works for sessions but not registrations

I have the following code in routes.rb: 我在routes.rb中有以下代码:

devise_for :admin_users, controllers: {
  registrations: 'tap/registrations',
  sessions: 'tap/sessions',
  passwords: 'tap/passwords',
  confirmations: 'tap/confirmations'  
}

The code above creates the following routes: 上面的代码创建以下路线:

        new_admin_user_session GET    /admin_users/sign_in(.:format)    tap/sessions#new
            admin_user_session POST   /admin_users/sign_in(.:format)    tap/sessions#create
    destroy_admin_user_session DELETE /admin_users/sign_out(.:format)   tap/sessions#destroy
           admin_user_password POST   /admin_users/password(.:format)   tap/passwords#create
       new_admin_user_password GET    /admin_users/password/new(.:format)  tap/passwords#new
      edit_admin_user_password GET    /admin_users/password/edit(.:format) tap/passwords#edit
                               PATCH  /admin_users/password(.:format)   tap/passwords#update
                               PUT    /admin_users/password(.:format)   tap/passwords#update

For some reason, the registrations and confirmations controller are not appearing in routes. 由于某种原因,注册和确认控制器未出现在路线中。 How do I fix this? 我该如何解决?

内部模型(admin_users.rb)中是否在下面添加了此行,可能此链接可以为您提供更多帮助

devise :database_authenticatable, :registerable

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM