[Ruby] link_to or button_to external url
Neil Moomey
neil at motznik.com
Thu Dec 28 14:04:13 PST 2006
Oh, I feel like a dummy for not catching that. This works great:
<%= button_to :Google, 'http://www.google.com' %>
or
<%= link_to 'Google', 'http://www.google.com' %>
Thanks everyone.
Neil
On 12/28/06, Eric Hodel <drbrain at segment7.net> wrote:
> 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!
>
> _______________________________________________
> Ruby at zenspider.com - Seattle.rb non-commercial list
> http://www.zenspider.com/seattle.rb
> http://www.zenspider.com/mailman/listinfo/ruby
>
--
Neil Moomey
Software Developer
Motznik Information Services
8301 Briarwood Street, Suite 100
Anchorage, AK 99518
Ph. 907.344.6254 Fax: 907.344.1759
More information about the Ruby
mailing list