I have a text area into which users enter a lot of text that potentially includes hyperlinks. How can I display the text and have the URLs automatically appear as hyperlinks? Is there a gem, plugin, or existing method that does this? I'm looking to be able to do something like:
<%=h @my_object.description.with_links %>
in my view.
views:
16answers:
1
+2
A:
Rails has a helper method called auto_link
. Which is part of ActionPack.
In your case you could do this:
<%=h auto_link(@my_object.description) %>
Joseph Silvashy
2010-06-22 16:46:39
Thank you very much!
Clay
2010-06-22 16:58:38