title: set default_url_options on initialize
body: <p>I need to force the host in one of the environments in my rails app.</p>
  
  <p>I've can get the override to work by including</p>
  
  <pre><code>  def default_url_options(opts={})
     opts.merge({:host =&gt; 'stg.my-host.com'})
    end
  </code></pre>
  
  <p>in app/controllers/application.rb</p>
  
  <p>But is there a way to set this on initialize, preferably in a config/environments/... file?  I'd like to keep conditional env logic out of the controller.</p>
  
  <p>But when I try</p>
  
  <pre><code>   config.action_controller.default_url_options = { ... }
  </code></pre>
  
  <p>or even</p>
  
  <pre><code>ActionController::Base.default_url_options = { ... }
  </code></pre>
  
  <p>I get "undefined method," even if a wrap in a config.after_initialize { ... }</p>
  
  <p>any thoughts?</p>