views:

42

answers:

1

I have a rails application where I allow users to enter comments. The comments are displayed back like so

<%= simple_format(sanitize(c.comment)) %>

If a user enters the following the in the comment link this link gets appended to the end of the rails root directory. So if someone clicked on the link the would go to

www.somedomain.com/myrailsapp/www.blah.com

What can I do to correct this?

Thanks

+1  A: 

You will need to append "http://" in the href attribute of the anchor tags.

And if you aren't using it, may I suggest the auto_link helper method. It will automatically do what you are looking for.

erik
That worked. thanks.
Maulin