0

当我单击 Devise 的“向我发送重置密码说明”链接时,我得到了;

ArgumentError in Devise/passwords#create

Extracted source (around line #5):

2:   
3: Someone has requested a link to change your password, and you can do this through the link below.
4:  
5: <%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>  
6:  
7: If you didn't request this, please ignore this email.
8: Your password won't change until you access the link above and create a new one.

有人知道我为什么会收到这个错误吗?我没有更改此文件中的任何内容。

4

2 回答 2

0

尝试添加

resources :passwords

在你的 routes.rb

您还需要设置一个邮件程序

# Setup for production - deliveries, no errors raised
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"

ActionMailer::Base.smtp_settings = {
  :address => "smtp.yourmail.com",
  :port => 587,
  :authentication => :plain,
  :domain => ENV['SMTP_USER'],
  :user_name => ENV['SMTP_USER'],
  :password => ENV['SMTP_PASSWORD'],
}
于 2012-12-16T14:26:54.727 回答
0

实际上,该文件是发送给用户的电子邮件模板。你应该检查邮件设置...

于 2012-12-16T14:17:10.377 回答