> -----Original Message-----
> From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
[mailto:rubyonrails-
> talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of mr_robot
> Sent: 12 December 2006 12:19
> To: Ruby on Rails: Talk
> Subject: [Rails] Finding url in text
>
>
> is there a way of finding urls in a block of text that a user has
> entered and then automatically formatting is so that it becomes a live
> link
Rails has a helper for just this thing - ''auto_link''
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M00051
4
Turns all urls and email addresses into clickable links. The link parameter
can limit what should be linked. Options are :all (default),
:email_addresses, and :urls.
Example:
auto_link("Go to http://www.rubyonrails.com and say hello to
david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org") =>
Go to <a
href="http://www.rubyonrails.com">http://www.rubyonrails.com</a>
and
say hello to <a
href="mailto:david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org">david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org</a>
hth
--
Richard Livsey
Head of Agile Development, CitySafe
http://citysafe.org ....... CitySafe
http://thatsprogress.com .. The Fitness Community (soon)
http://livsey.org ......... Blog : Musings of a Rails Developer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---