title: make rails url helpers use the appropriate protocol?
body: <p>Hey, I'm allowing my app to be accessed via https and http, and everything is working fine except for when I use any of the <code>_url</code> methods. If I access a view that uses such a method via https, it does get served as https, but the generated url uses the http protocol. I'm wondering if this is normal, or if there is a way to make it automatic. I was hoping rails would automatically generate the appropriate url based on how the page was accessed.</p>
  
  <p>If there's no way around this, what would be the best way to create the appropriate url? Would this work?</p>
  
  <pre><code>if request.ssl?
    some_url(:protocol =&gt; "https")
  else
    some_url
  end
  </code></pre>
  
  <p>I would prefer it if I could come up with a more automatic approach. Maybe if the rails url methods generated <code>://somedomain.com/some/path</code>, that way I imagine it would automatically adapt the correct protocol.</p>
  
  <p>Thanks, I would appreciate any help.</p>