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

<%= auto_link("Text with a URL, e.g.http://www.google.com and the link will become clickable") %>

See Rails API for more info on this.

Rails has a helper for just this thing - 'auto_link'

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@loudthinking.com") =>

    Go to <a href="http://www.rubyonrails.com">http://www.rubyonrails.com</a> and     say hello to <a href="mailto:david@loudthinking.com">david@loudthinking.com</a>

hth