title: link_to external URL treated as internal despite starting with http:// (Rails 2)
body: <p>I'm using </p>
  
  <pre><code>link_to "Click Here", "http://www.cnn.com"
  </code></pre>
  
  <p>and its producing a link with the following href</p>
  
  <pre><code>"localhost:3000http://www.cnn.com"
  </code></pre>
  
  <p>For some reason, it's not recognizing the <code>http://</code> as indicating an external URL, and treating it as a relative URL.</p>
  
  <p>I tried going to the source of <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to" rel="nofollow">link_to</a> and copied it into my application helper. I found that the <code>.html_safe</code> was doing the transformation, because when I pulled it out, it worked as expected. </p>
  
  <p>I can't figure out which <code>html_safe</code> its using. When I copied in the source of <a href="http://haml-lang.com/docs/yardoc/Haml/Util.html#html_safe-instance_method" rel="nofollow">HAML:Util.html_safe</a> it also worked fine. Therefore, I assume the <code>html_safe</code> that <code>link_to</code> is using is resolving to something else, even though the view is a Haml file.</p>
  
  <p>Based on what I see in the Haml method, it seems that <code>html_safe</code> calls <code>html_safe!</code> to transform the string when it thinks its unsafe.</p>
  
  <p>I'm using the normal American English/Latin character set, so I don't see why it's not parsing the <code>http://</code> correctly</p>
  
  <p>I'm using Rails 2.3.5.</p>
  
  <p>For now, I plan to hand-code the href into my view to avoid calling <code>link_to</code> for the external link, but if anyone can help me figure out what is going on, I'd greatly appreciate it. Thanks!</p>