gpt4 book ai didi

ruby-on-rails - 设计 edit_account_password 操作将我重定向到根目录

转载 作者:行者123 更新时间:2023-12-03 16:06:15 26 4
gpt4 key购买 nike

这是我的设计路线:

devise_for :accounts, :path_names => { :sign_up => "new" } do
get "sign_in", :to => "devise/sessions#new"
get "sign_out", :to => "devise/sessions#destroy"
get "/change_password", :to => "devise/passwords#edit"
end

而我的 rake routes 的输出:
       account_password POST   /accounts/password(.:format)                {:controller=>"devise/passwords", :action=>"create"}
new_account_password GET /accounts/password/new(.:format) {:controller=>"devise/passwords", :action=>"new"}
edit_account_password GET /accounts/password/edit(.:format) {:controller=>"devise/passwords", :action=>"edit"}
PUT /accounts/password(.:format) {:controller=>"devise/passwords", :action=>"update"}

所以change_password路由没有到位和 /change_password只是将我重定向到 root_path。请帮助我了解原因,否则我会伤害自己。谢谢你。

最佳答案

好的,我发现了问题所在。编辑密码来自 Recoverable 模块,它旨在帮助用户在忘记密码时找回他/她的密码,而不是让登录用户更改他/她的密码。您可以改用注册/编辑。

关于ruby-on-rails - 设计 edit_account_password 操作将我重定向到根目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5979050/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com