Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails mailer edit_user_url uses http not https

My entire app is https, no http.

If add the following to any of the views

I get a "edit user" linked to

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

Notice the "http" instead of "https"??

Using

rails 3.0.5 and ruby 1.8.7

like image 261
Nutty Hiker Avatar asked Apr 22 '11 22:04

Nutty Hiker


2 Answers

I believe that you have to put in your config/environments/production.rb:

config.action_mailer.default_url_options = {:protocol => 'https'}
like image 161
Roman Avatar answered Nov 16 '22 04:11

Roman


Editing my config/environments/development file with

host = "hostaddress.io"    
config.action_mailer.default_url_options = { host: host, protocol: 'https' }

worked for me on Rails 4.2.2.

like image 34
tacos1998 Avatar answered Nov 16 '22 05:11

tacos1998