title: Where to set host for Rails.application.routes.url_helpers
body: <p>In a controller I call a service like:</p>
  
  <pre><code>MyService.call
  </code></pre>
  
  <p>In the <code>MyService.call</code> method I want to use a url helper:</p>
  
  <pre><code>Rails.application.routes.url_helpers.something_url
  </code></pre>
  
  <p>However, I get the error:</p>
  
  <pre><code>Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
  </code></pre>
  
  <p>in config/environments/development.rb I have:</p>
  
  <pre><code>config.action_mailer.default_url_options = { host: 'localhost:3000' }
  config.action_controller.default_url_options = { host: 'localhost:3000' }
  </code></pre>
  
  <p>What should I set not to get the error?</p>