Rails: Does the option :host work in link_to?

S

shiwei zhang

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top