For example,
User adds this “iamsmelly.com”.
And if I add an href to this, the link would be
http://www.mywebsite.com/iamsmelly.com
Is there a way to make it absolute if its not prepended by an http:// ?
Or should I revert to jQuery for this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Probably a good place to handle this is in a
before_saveon your model. I’m not aware of a predefined helper (thoughauto_linkcomes somewhat close) but a relatively simple regexp should do the job: