我在我的 Rails 应用程序中使用设计。出于某种原因,当您单击“发送密码重置说明”按钮时,输入您的电子邮件后,它会将您带到一个带有此 url 的空白页面/users/password.user
。我不知道它为什么这样做,也不知道如何改变它。
我不确切知道要发布什么代码,所以只需评论您希望我添加的摘录。谢谢。
作为记录,密码重置电子邮件和更改密码令牌完美运行,它只是这个奇怪的重定向(或缺少重定向)。
这些是路线:
devise_for :users, :controllers => {:registrations => 'registrations', :invitations => 'invitations', :confirmations => 'confirmations'}, :except => [:show]
密码路径助手是edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
config.reset_password_keys:
config.reset_password_keys = [ :login ]
密码重置表格:
<head>
<%= stylesheet_link_tag "passreset" %>
</head>
<body>
<div id="box">
<%= form_for(resource, :as => resource_name, :url => user_password_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>
<%= f.text_field :id,:name => "user[login]", :placeholder => "Username or Email"%>
<input name="commit" type="submit" name="" value="Submit" />
<% end %>
</div>
</body>