加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 设计忘记密码正在产品上创建与localhost的链接

发布时间:2020-12-17 04:27:35 所属栏目:百科 来源:网络整理
导读:我们正在使用标准设计忘记密码邮件: pHello %= @resource.email %!/ppSomeone has requested a link to change your password,and you can do this through the link below./pp%= link_to 'Change my password',edit_password_url(@resource,:reset_passwor
我们正在使用标准设计忘记密码邮件:
<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>

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

http://localhost:3000/users/password/edit?reset_password_token=amqs2q9NcM1FerHKhmzV

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

config.action_mailer.default_url_options = { :host => 'mysite.com' }

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

谢谢

解决方法

我的猜测是在某处覆盖了config.action_mailer.default_url_options.您是否在配置/初始化程序中有任何影响ActionMailer的文件?

尝试在生产盒上运行rails console,看看是什么

ActionMailer::Base.default_url_options[:host]

回报.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读