I want users in my Rails app to be able to share a link to their personal site in their profile. Simple enough, I have a column called website and a text box that they can fill in to make it work.
However, when I show this in a view, a problem arises. If I use the link_to , then regardless of whether the person will include http:// , whether the URL will work. But, if I automatically add http:// , then I will get it twice for users who DID put it in their url.
I am sure this is a fairly common problem, but I could not find any good blog posts or SO issues that affect it.
My question is: How do you handle the URL from users in your applications? What would you recommend as the most user-friendly way to standardize the URLs that are ultimately stored in db?
Thanks!
source share