I'd like Users in my Rails app to be able to share a link to their personal website in their profile. Simple enough, I have a column called website
and a text field they can fill in to make it work.
However, when I display this in a view there's a problem. If I use the link_to
helper then whether or not the person included the http://
determines whether or not the url will work. But, if I automatically prepend http://
then I get it twice for users who DID put it in their url.
I'm sure this is a fairly common problem, but I haven't been able to find any good blog posts or SO questions that address it.
My question is: How do you handle URL input from users in your apps? What would you recommend as the most user-friendly way to standardize the urls that end up being stored in the db?
Thanks!