title: How does rails 4 generate _url and _path helpers
body: <p>I am confused about how Rails 4 generates urls using _url and _path helpers.
  My configuration is I have a hardware device handling https requests which routes to nginx serving static files and referring rails requests to a thin server.</p>
  
  <p>In my config/environments/production.rb i have</p>
  
  <p><code>config.action_controller.default_url_options = {host: "mydomain", protocol: 'https'}</code></p>
  
  <p>If I issue a redirect in a controller using an `_path helper it tries to redirect to the nginx port. (which is not accessible externally)
  If I issue a redirect in a controller using an _url helper it redirect correctly according to the config.</p>
  
  <p>In a view a link_to _path and _url generate the correct url</p>
  
  <p>So I have two questions
  Why do the helpers work differently in a view and in a controller.
  Is there a way to generate the correct url using _path or should I change everything to _url - and is there a downside to that?</p>
  
  <p>thanks in advance</p>
  
  <p>Andy</p>