MarkD
MarkD

Reputation: 75

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?

Upvotes: 0

Views: 313

Answers (1)

Alex Kojin
Alex Kojin

Reputation: 5204

Add in production.rb file:

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

Upvotes: 1

Related Questions