简体   繁体   English

Rails / Devise-忘记密码功能错误

[英]Rails/Devise--Forgot Password Feature Errors Out

When a user forgets their password on my app they are able to type in their email address and have password reset instructions sent to their email box like so: 当用户忘记了我的应用程序上的密码时,他们可以输入其电子邮件地址,并将密码重置说明发送到其电子邮件框中,如下所示:

在此处输入图片说明

When I click the 'Change my password' link I get the Heroku 'We're sorry but something went wrong' error. 当我单击“更改我的密码”链接时,出现Heroku“很抱歉,但出了点问题”错误。 Looking at the heroku logs here is what is going wrong ("Template::Error (wrong number of arguments (3 for 1..2))): 在这里查看heroku日志是出了什么问题(“ Template :: Error(错误的参数数量(1..2为3))):

在此处输入图片说明

Any thoughts on what is causing an extra argument to be passed? 对什么导致额外的论点传递有什么想法?

try to delete the second argument resource , you have one extra argument there so I think it's this one. 尝试删除第二个参数resource ,那里有一个额外的参数,所以我想就是这个。 If it's still complaining then replace that part with : 如果仍在抱怨,则将该部分替换为:

resource, as: resource_name,

this is what my devise password edit form looks like in this specific part: 这是我的设计密码编辑表单在此特定部分中的外观:

<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>

Mines work perfect with Heroku. 矿井与Heroku完美搭配。 I see that you may have an extra argument. 我认为您可能还有其他争论。 Try to compare mines with yours to figure out the fix. 尝试将地雷与您的地雷进行比较以找出解决方法。

you can replace 你可以更换

resource_name, resource

with

resource, as: resource_name,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM