设计忘记密码是否在产品上创建了与localhost的链接?

AnA*_*ice 7 ruby-on-rails devise ruby-on-rails-3

我们正在使用标准设计忘记密码邮件:

<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>
Run Code Online (Sandbox Code Playgroud)

在生产时,这是为更改密码生成本地主机URL:

http://localhost:3000/users/password/edit?reset_password_token=amqs2q9NcM1FerHKhmzV
Run Code Online (Sandbox Code Playgroud)

鉴于production.rb文件包含我们的域名,这很奇怪:

config.action_mailer.default_url_options = { :host => 'mysite.com' }
Run Code Online (Sandbox Code Playgroud)

为什么没有在URL中使用mysite.com?想法?

谢谢

Ale*_*tie 17

我的猜测是config.action_mailer.default_url_options在某处被覆盖.你有任何文件config/initializers影响ActionMailer吗?

尝试rails console在您的生产箱上运行,看看是什么

ActionMailer::Base.default_url_options[:host]
Run Code Online (Sandbox Code Playgroud)

回报.