[英]devise forgot password function not working when creating own user controller?
我使用devise进行身份验证,并创建了一个用户控制器,并按如下所示在我的路线中进行了指定,这使我可以创建用户,编辑和删除用户,
devise_for :users do
resources :users, :only => [:index, :new, :create, :edit, :update, :destroy]
end
但是我无法使用此功能使忘记密码功能正常工作,但如果我指定为
devise_for :users
那么我可以使用devise附带的忘记密码功能,而当我这样指定时,我无法创建,编辑或删除。 那么我该如何使两者同时起作用? 请帮我
终于我有了我一直在寻找的方式,就是这样...
devise_for :users do
resources :users, :only => [:create]
end
devise_scope :user do
resources :users, :only => [:index, :new, :create, :edit, :update, :destroy]
end
更改用户的路线,请参阅此
像这样的路线
devise_for :users, :path => "usuarios", :path_names => { :sign_in => 'login', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification', :unlock => 'unblock', :registration => 'register', :sign_up => 'cmon_let_me_in' }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.