[Ruby] link_to or button_to external url

Eric Hodel drbrain at segment7.net
Thu Dec 28 13:52:35 PST 2006


On Dec 28, 2006, at 13:46, Neil Moomey wrote:

> None of those are working for me.
>
> <%= link_to 'Google', 'http:/www.google.com' %>
> gives me:
> http://localhost:3004/www.google.com

I think you're missing the other slashe there.  (why is rails  
apparently parsing?)

> <%= link_to :Google, :only_path => false, :host => 'www.google.com' %>
> gives me:
> http://www.google.com/pfd_applicants/search
>
> where search.rhtml is the page the link is on.

Oh, right, you'll have to clear out :controller, :model and :id  
because they get inherited. :P

PS: Please don't trim context.

-- 
Eric Hodel - drbrain at segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!



More information about the Ruby mailing list