Forum: Ruby Rails: Does the option :host work in link_to?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F8ec8cf1a30c1727aa57bd01136aaba7?d=identicon&s=25 shiwei zhang (Guest)
on 2007-05-25 14:27
(Received via mailing list)
Hi,

I used the following code line in a View file on machine
http://xx.test.com:7777:
<%= link_to "GoToAnotherHost", { :protocol => "http", :host =>
"app1books.test.com:7777", :controller => "admin", :action => "list" }
%>
However the result is: the link "GoToAnotherHost" is always pointed to
http://xx.test.com:7777/admin/list rather than
http://app1books.test.com:7777/admin/list. I.e., the :host doesn't take
effect at all!
What's wrong with this? Do you meet the same problem?

Many Thanks!
Shiwei
Ff9e18f0699bf079f1fc91c8d4506438?d=identicon&s=25 James Britt (Guest)
on 2007-05-25 15:56
(Received via mailing list)
shiwei zhang wrote:
> Hi,
>
> I used the following code line in a View file on machine
> http://xx.test.com:7777:

Rails questions are best asked on the Rails mailing list, where you will
get a better, faster, answer; details may be found at
www.rubyonrails.com




--
James Britt

"Hackers will be expelled"
  -  The Breakfast Club (1985)
This topic is locked and can not be replied to.