Is there a link_to 'external url'?


#1

I’ve checked the Rails documentation but find no mention of link_to
‘external url’ or equivalent. Does rails have a built in method to do
this?

thanks
-Lindsay


#2

Lindsay B. wrote:

I’ve checked the Rails documentation but find no mention of link_to
‘external url’ or equivalent. Does rails have a built in method to do
this?

http://lists.rubyonrails.org/pipermail/rails/2006-January/008448.html

Google saves the day.


#3

David wrote:

Google saves the day.

Cheers David. That’s good to know.

When I apply this to my app I now have a new problem: my app allows
users to enter URLs with or without an ‘http://’. When the URLs are
displayed, I want them to be linkable, so I can use link_to, but I have
to check to see if ‘http://’ is present. So, looks like I will have to
write my own method.

thanks
-Lindsay


#4

On Tuesday 02 May 2006 16:02, Lindsay B. wrote:

I’ve checked the Rails documentation but find no mention of link_to
‘external url’ or equivalent. Does rails have a built in method to do
this?

<%= link_to “Click here to visit my site”, “http://www.example.com/” -%>

~Dave

Dave S.
Rent-A-Monkey Website Development
http://www.rentamonkey.com/

PGP Key: http://www.rentamonkey.com/pgpkey.asc


#5

Check out auto_link:
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M000514


#6

link_to “Google”, “http://www.google.com

Tom


#7

Just out of curiosity, why would you use the link_to helper for an
external url?

Charlie B.
www.recentrambles.com