2
嗨我试图使用bcrypt在rails中忘记密码。我已经采用了bcrypt文档中描述的方法“forgot_password”,并为它制作了一个邮件程序。 我已经在我的用户模型中设置了此方法,比如self.forgot_passwordRails bcrypt丢失密码
我试图在会话/新登录表单中调用此方法,但我认为我没有很好的方法去做吧。 这里是我的表单代码:
<%= form_for :user, :url=>{:action=>"forgot_password"} do |f| %>
<p>Réintialiser mon mot de passe en renseignant votre email ci-dessous :</p>
<div class="field">
<%= f.text_field :email, :placeholder=>"ex: [email protected]" %>
</div>
<div class="actions">
<%= f.submit "Me renvoyer un email", :class => 'btn btn-warning' %></center>
</div>
<% end %>