mercredi 6 septembre 2017

How convert 'link_to' to Absolute in Rails

I've a problem in my program, I add in DB a link, for example, "www.google.com" and when I clic in the link I'm redirected to localhost:3000/www.google.com, this doesn't happen when I put "http://www.google.com" in DB.

My code

<td><%= link_to t.title, t.link_to_idea, :target => "_blank" %></td>

How do I make to convert this link always in absolute? (I think I this's solution)

Thanks!!

Aucun commentaire:

Enregistrer un commentaire