[英]How to change Reset Password URL in Devise RoR
我想更改RoR發出的密碼提示的網址。 詳細信息,要在域之后插入I18n.locale。 比方說
ttp://mydomain.com/users/password/edit?reset_password_token=gPudhxxxxxx2xTZ4hBeHeA
至
ttp://mydomain.com/en/users/password/edit?reset_password_token=gPudhxxxxxx2xTZ4hBeHeA
在我的reset_password_instructions.html.slim中,代碼是這樣的。
p
= (I18n.t "resetpassword_mailbody", email: @resource.email).html_safe
p
= link_to (I18n.t "change_my_passwd"), edit_password_url(@resource, reset_password_token: @token)
p
= (I18n.t "mail_footer").html_safe
我需要覆蓋edit_password_url嗎? 我該怎么辦? 請給我一些建議。
使用devise更改密碼控制器的路由。
devise_scope :user do
get 'cutom_url', to: 'devise/passwords#edit', as: :edit_user_registration
end
我想辦法。
p
= link_to (I18n.t "change_my_passwd"), edit_password_url(@resource, reset_password_token: @token, locale: I18n.locale)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.