设计重置密码问题

时间:2012-12-16 13:03:27

标签: ruby-on-rails ruby 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.

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

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分: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'],
}