Ruby on rails 设计嵌套时忘记密码
我在Heroku上运行的Rails 5应用程序使用Desive for auth,目前已嵌套。在routes.rb中看起来像这样:Ruby on rails 设计嵌套时忘记密码,ruby-on-rails,ruby,devise,Ruby On Rails,Ruby,Devise,我在Heroku上运行的Rails 5应用程序使用Desive for auth,目前已嵌套。在routes.rb中看起来像这样: resources :teams do member do get :about get :foundation end devise_for :users, :path_prefix => 'auth', :controllers => { :masquerades => "admin/masquerad
resources :teams do
member do
get :about
get :foundation
end
devise_for :users, :path_prefix => 'auth',
:controllers => {
:masquerades => "admin/masquerades",
:registrations => "registrations",
:sessions => "sessions",
:password => "passwords"
}
当我试图设置忘记密码时,我会一个接一个错误地得到错误的路径,因为Desive的所有标准都指向新用户会话路径
,而不是新用户会话路径
当前我遇到此错误:undefined method new\u user\u session\u路径
我的想法是生成设计视图和控制器,并修复所有链接。但是,当前错误不会出现在我从源代码获取的密码控制器中:https://github.com/plataformatec/devise/blob/master/app/controllers/devise/passwords_controller.rb
我的问题是:我想添加一个“重置密码”功能,并有嵌套的设计路由。我如何解决这个问题
编辑:
这里是来自耙路由的输出:
new_user_team_session GET /auth/users/teams/:team_id/sign_in(.:format) sessions#new
user_team_session POST /auth/users/teams/:team_id/sign_in(.:format) sessions#create
destroy_user_team_session DELETE /auth/users/teams/:team_id/sign_out(.:format) sessions#destroy
new_user_team_password GET /auth/users/teams/:team_id/password/new(.:format) devise/passwords#new
edit_user_team_password GET /auth/users/teams/:team_id/password/edit(.:format) devise/passwords#edit
user_team_password PATCH /auth/users/teams/:team_id/password(.:format) devise/passwords#update
PUT /auth/users/teams/:team_id/password(.:format) devise/passwords#update
POST /auth/users/teams/:team_id/password(.:format) devise/passwords#create
cancel_user_team_registration GET /auth/users/teams/:team_id/cancel(.:format) registrations#cancel
new_user_team_registration GET /auth/users/teams/:team_id/sign_up(.:format) registrations#new
edit_user_team_registration GET /auth/users/teams/:team_id/edit(.:format) registrations#edit
user_team_registration PATCH /auth/users/teams/:team_id(.:format) registrations#update
PUT /auth/users/teams/:team_id(.:format) registrations#update
DELETE /auth/users/teams/:team_id(.:format) registrations#destroy
POST /auth/users/teams/:team_id(.:format) registrations#create
back_user_team_masquerade_index GET /auth/users/teams/:team_id/masquerade/back(.:format) admin/masquerades#back
user_team_masquerade GET /auth/users/teams/:team_id/masquerade/:id(.:format) admin/masquerades#show
干杯rake routes的输出是什么?这个:path\u prefix=>“auth”
一定很神奇。这是rake路由的输出:你能把它添加到问题本身吗?添加了rake路由的输出。@JagdeepSingh我很乐意跳到codementor上,然后把结果发布到这里。