# Problem in link\_to

**URL:** <https://www.ruby-forum.com/t/problem-in-link-to/150272>\
**Category:** Rails\
**Created:** [October 6, 2008, 7:33pm UTC](https://www.ruby-forum.com/t/problem-in-link-to/150272 "2008-10-06T19:33:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [October 6, 2008, 7:33pm UTC](https://www.ruby-forum.com/t/problem-in-link-to/150272/1 "2008-10-06T19:33:40Z")

</div>

Hi. I am developing a Personal Blog using Rails. In Comment model, i  
have a database field called “website”, which people who comment on an  
article may use it to add their website. Its working good. But in the  
“show” view of an article, the website link in the comments section is  
displayed as [http://localhost:3000/articles/www.someuser.com](http://localhost:3000/articles/www.someuser.com) and if i  
click it shows a Page not found error.

The code i used is

\<% link\_to ‘comment.website’, 'comment.website %\>

Someone please solve this issue. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [October 6, 2008, 7:46pm UTC](https://www.ruby-forum.com/t/problem-in-link-to/150272/2 "2008-10-06T19:46:57Z")

</div>

If you want to link to an external address the string must be appended  
by protocol you are using (http:// , ftp://)

i.e.

\<%= link\_to “[www.google.com](http://www.google.com)”, “[http://www.google.com](http://www.google.com)” %\>

---

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [October 6, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/problem-in-link-to/150272/3 "2008-10-06T19:50:32Z")

</div>

Thank you Adams. Problem solved
