I have an application with the domain "www.mysite.com", which hosts the Rails application for Drupal and "app.mysite.com".
I have a situation where the search engine URL points to "www.mysite.com" instead of "app.mysite.com".
In devise.rb, I have the settings as shown below:
config.mailer = "Devise::Mailer" ActionMailer::Base.default_url_options = { :host => 'app.mysite.com' }
And in production.rb:
config.action_mailer.default_url_options = { :host => 'app.mysite.com' } ActionMailer::Base.smtp_settings = { :address => 'smtp.sendgrid.net', # SendGrid SMTP server :domain => 'mysite.com', # SendGrid account domain name :user_name => 'username', # SendGrid user name :password => 'password', # SendGrid password :enable_starttls_auto => true, :port => 587, :authentication => :plain, }
In the views / devise / mailer / reset _password_instructions.html.erb, the confirmation link looks something like this:
<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>
It successfully sends an email after clicking the link to the password link and works like a charm on localhost, but the URL node points to www.mysite.com
instead of app.mysite.com
and gives a 404 error.
How can I point it to the correct host?
source share