Rails - 重置密码链接不起作用(设计)

时间:2014-02-13 12:01:31

标签: ruby-on-rails devise

在重置密码邮件中,我得到链接

http//example.com/users/password/edit?reset_password_token而不是

http://example.com/users/password/edit?reset_password_token.

reset_password_instructions.html.erb

<p>Hello <%= @resource.email %>!</p>

<p>Someone has requested a link to change your password, and you can do this through the link below.</p>

<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>

<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>

1 个答案:

答案 0 :(得分:0)

在devise.rb中,您必须进行更改

config.mailer_sender = 'your_mail@gmail.com'

并将以下内容添加到development.rb

  config.action_mailer.smtp_settings = {
 :address              => "smtp.gmail.com",
 :port                 => 587,
 :domain               => 'domain.com',
 :user_name            => '*********@gmail.com',
 :password             => '***********',
 :authentication       => :plain,
 :enable_starttls_auto => true  }

允许在Gmail中使用不太安全的应用 重新启动服务器