ruby on rails - How do I prevent getting a routing error while trying to access a href -
i have href rendered "www.yahoo.com", when user clicks on instead of re-directing http://www.yahoo.com page says route not found error. how fix this?
try this:
<%= link_to "click me", "http://www.yahoo.com" %>
it's need put http://
before address.
updated (according comment)
ok this:
let,
@url = "www.yahoo.com"
now,
<%= link_to "click me", "http://#{@url}" %>
Comments
Post a Comment