[英]Rails _url helper and force_ssl
I have the following in production.rb: 我在production.rb中具有以下内容:
config.force_ssl = true
Now, when using 现在,当使用
path_to_page_url(@record)
in an email, the url that is generated looks like this: 在电子邮件中,生成的URL如下所示:
https://example.com https://example.com
which times out. 哪个超时。
However, https://www.example.com does not time out. 但是, https: //www.example.com不会超时。
Is there any way to add the "www" prefix to the url helper? 有什么方法可以将“ www”前缀添加到url帮助器中?
添加production.rb文件:
config.action_mailer.default_url_options = { host: 'www.example.com', protocol: 'https'}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.