# The link\_to url problem

**URL:** <https://www.ruby-forum.com/t/the-link-to-url-problem/93199>\
**Category:** Rails\
**Created:** [April 29, 2007, 5:33am UTC](https://www.ruby-forum.com/t/the-link-to-url-problem/93199 "2007-04-29T05:33:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent.Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@Vincent.Z](https://www.ruby-forum.com/u/Vincent.Z)\
**Post date:** [April 29, 2007, 5:33am UTC](https://www.ruby-forum.com/t/the-link-to-url-problem/93199/1 "2007-04-29T05:33:13Z")

</div>

hi,all  
im making one tag,such as : \<%=link\_to “test”,  
{:host=\>“[www.itsdargens.com](http://www.itsdargens.com)”,:controller=\>“vivid”}%\>

but,the “:host” tag didnt work properly.it always render the “http://  
127.0.0.1:3000/vivid” that is my localhost server.

have you ever found the same problem? thanks

---

<div class="post-metadata">

**Author:** ![Vincent.Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@Vincent.Z](https://www.ruby-forum.com/u/Vincent.Z)\
**Post date:** [April 29, 2007, 10:55am UTC](https://www.ruby-forum.com/t/the-link-to-url-problem/93199/2 "2007-04-29T10:55:14Z")

</div>

Vincent.Z wrote:

> hi,all  
> im making one tag,such as : \<%=link\_to “test”,  
> {:host=\>“[www.itsdargens.com](http://www.itsdargens.com)”,:controller=\>“vivid”}%\>
> 
> but,the “:host” tag didnt work properly.it always render the “http://  
> 127.0.0.1:3000/vivid” that is my localhost server.

I ever don’t know there is a :host option. But if you really want to  
link to [http://a.url.com/vivid](http://a.url.com/vivid), you can using:  
\<%link\_to(“test”, “[http://a.url.com/vivid](http://a.url.com/vivid)”)%\>  
or just using a html tag directly.

---

<div class="post-metadata">

**Author:** ![Vincent.Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@Vincent.Z](https://www.ruby-forum.com/u/Vincent.Z)\
**Post date:** [April 29, 2007, 11:01am UTC](https://www.ruby-forum.com/t/the-link-to-url-problem/93199/3 "2007-04-29T11:01:33Z")

</div>

Vincent.Z wrote:

> im making one tag,such as : \<%=link\_to “test”,  
> {:host=\>“[www.itsdargens.com](http://www.itsdargens.com)”,:controller=\>“vivid”}%\>
> 
> but,the “:host” tag didnt work properly.it always render the “http://  
> 127.0.0.1:3000/vivid” that is my localhost server.

Try adding an :only\_path =\> false option.

–  
We develop, watch us RoR, in numbers too big to ignore.
