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

Popular posts from this blog

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -