title: How to get the right redirection from email when reset password?
body: <p>I have Sample App by Michael Hartl's  “Ruby on Rails Tutorial”.</p>
  
  <p>If I click on “Forget Password”, I've got email notification and if click on  link “Reset password”, I’ve got redirected to the wrong app that doesn’t exist and I could  see  only  empty page.</p>
  
  <blockquote>
    <p><a href="https://wrong.com/password_resets/WTk_raloURf8I8sCaXNNkg/edit?email=tatyana_p%70yahoo.com" rel="nofollow noreferrer">https://wrong.com/password_resets/WTk_raloURf8I8sCaXNNkg/edit?email=tatyana_p%70yahoo.com</a></p>
  </blockquote>
  
  <p>That wrong app existed earlier but was already deleted. 
  The code as below shows the correct host but   the redirection happened   to the wrong host.</p>
  
  <p><code>ENV['SENDGRID_USERNAME']</code> and <code>ENV['SENDGRID_PASSWORD']</code> are correct.</p>
  
  <p>I could not find a wrong name of the host anywhere else in code and change  it to the correct one. </p>
  
  <p><strong>config/environments/production.rb</strong></p>
  
  <pre><code>config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp
  host = 'correct_host.herokuapp.com'
  config.action_mailer.default_url_options = { host: host }
  ActionMailer::Base.smtp_settings = {
    :address        =&gt; 'smtp.sendgrid.net',
    :port           =&gt; '587',
    :authentication =&gt; :plain,
    :user_name      =&gt; ENV['SENDGRID_USERNAME'],
    :password       =&gt; ENV['SENDGRID_PASSWORD'],
    :domain         =&gt; 'heroku.com',
    :enable_starttls_auto =&gt; true
  }
  </code></pre>
  
  <p>If I copy and paste an address that I've got when I click on "Reset password"
  and changed the wrong address on the right one - I've got the right fields for  a password  and confirming password.</p>
  
  <blockquote>
    <p><a href="https://correct_host.herokuapp.com/password_resets/WTk_raloURf8I8sCaXNNkg/edit?email=tatyana_p%70yahoo.com" rel="nofollow noreferrer">https://correct_host.herokuapp.com/password_resets/WTk_raloURf8I8sCaXNNkg/edit?email=tatyana_p%70yahoo.com</a></p>
  </blockquote>