Rails 邮件程序 edit_user_url 使用 http 而不是 https [英] Rails mailer edit_user_url uses http not https
本文介绍了Rails 邮件程序 edit_user_url 使用 http 而不是 https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的整个应用都是 https,没有 http.
My entire app is https, no http.
如果将以下内容添加到任何视图中
If add the following to any of the views
我得到一个链接到
https://localhost:3000/user/2/edit
但是当我在邮件视图中放置同一行时,电子邮件包含
But when I place the same line in a mailer view the email contains
http://localhost:3000/user/2/edit
注意http"而不是https"??
Notice the "http" instead of "https"??
使用
rails 3.0.5 和 ruby 1.8.7
rails 3.0.5 and ruby 1.8.7
推荐答案
我相信你必须把你的 config/environments/production.rb :
I believe that you have to put in your config/environments/production.rb:
config.action_mailer.default_url_options = {:protocol => 'https'}
这篇关于Rails 邮件程序 edit_user_url 使用 http 而不是 https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文