title: Trouble configuring ActionMailer default_url_options from Rails 4 app
body: <p>I was getting the following error when sending a mail (though mail worked correctly previously):</p>
  
  <pre><code>"Missing host to link to! Please provide the :host parameter or set default_url_options[:host] (ActionView::Template::Error)"
  </code></pre>
  
  <p>I was sure that I has set my action mailer config correctly and, on inspection, I was right. However, it seems that Rails randomly stopped picking up this configuration. </p>
  
  <p>When I tried accessing the <code>default_url_options</code> on a view to check they're being set, it would show an empty hash.</p>
  
  <p>My only solution was to replace this:</p>
  
  <pre><code>config.action_mailer.default_url_options = {:host =&gt; "localhost:3000"}
  </code></pre>
  
  <p>with this:</p>
  
  <pre><code>ActionMailer::Base.default_url_options  = {:host =&gt; "localhost:3000"}
  </code></pre>
  
  <p>Which I would interpret as the same thing. This worked fine but I'm still confused over what went wrong here. My Gemfile didn't change or anything like that - a bit of a mystery.</p>