0
我正在尝试构建自定义重置密码功能。 我有一个表单上我的看法在设计用户上更改密码
<div class="form-group">
<%= f.label :password %>
<%= f.password_field :password, autofocus: true, title:"Enter your email", name:"password", id:"password", class:"form-control" %>
<span class="help-block small">Password</span>
</div>
<div class="form-group">
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, autofocus: true, title:"Enter your email", name:"password_confirmation", id:"password_confirmation", class:"form-control" %>
<span class="help-block small">Confirm Password</span>
</div>
<div class="actions"><%= f.submit "Update Password", class:"btn btn-success btn-block" %></div>
然后我控制器上我试图更改密码和password_confirmation领域。
@user.update_attributes({:password => params[:password], :password_confirmation => params[:password_confirmation]})
它似乎密码正在改变,但当我试图登录我不能!
请发布完整的erb代码片段,包括<%= form_for标记 – Phil