简体   繁体   中英

Rails _url helper and force_ssl

I have the following in 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:

https://example.com

which times out.

However, https://www.example.com does not time out.

Is there any way to add the "www" prefix to the url helper?

添加production.rb文件:

config.action_mailer.default_url_options = { host: 'www.example.com', protocol: 'https'}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM