Forum: Ruby on Rails Is there a link_to 'external url'?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-05-02 17:02
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
Bd3a4af368439803aa37d318f9941a9f?d=identicon&s=25 David (Guest)
on 2006-05-02 17:09
Lindsay Boyd 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-...

Google saves the day.
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-05-02 17:40
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
2f46d76f0e5db4dc318b03be07ebaac4?d=identicon&s=25 Tom Ward (Guest)
on 2006-05-03 18:59
(Received via mailing list)
link_to "Google", "http://www.google.com"

Tom
Cf7e5e4b5ca573eec214191fac420a2f?d=identicon&s=25 Dave Silvester (Guest)
on 2006-05-03 18:59
(Received via mailing list)
On Tuesday 02 May 2006 16:02, Lindsay Boyd 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 Silvester
Rent-A-Monkey Website Development
http://www.rentamonkey.com/

PGP Key: http://www.rentamonkey.com/pgpkey.asc
25e11a00a89683f7e01e425a1a6e305c?d=identicon&s=25 Wilson Bilkovich (Guest)
on 2006-05-03 18:59
(Received via mailing list)
89d967359903c639d31e4cad4569f537?d=identicon&s=25 Charlie Bowman (Guest)
on 2006-05-03 18:59
(Received via mailing list)
Just out of curiosity, why would you use the link_to helper for an
external url?

Charlie Bowman
www.recentrambles.com
This topic is locked and can not be replied to.