I have a model Image and every image is having description. User can add links in that description. Now while displaying that description I want link to display as normal link and should open in new tab.
Sample description can be:
Hey, thats sample text, you can find more photos at google.com
user can enter url like:
google.com,
http://www.google.com,
http://google.com,
http://www.google.com etc
I use auto_html gem for a similar use case. Say you have the text which contains the urls in variable
textthen you can do something like: