Link_to :protocol and :host?

Hello,

I am trying to set the protocol and host in link_to based on the
documentation.

I have the following:

<%= link_to “View Cart”, {:controller => ‘store’, :action =>
‘view_cart’,
:protocol => ‘https://’, :host => ‘secure.host.com’} %>

I would expect this to generate a https link to another host.

Instead, all I get is:

View Cart

Have I misunderstood the url_for specs?

Thanks,
Hunter

Hi,

On 11/13/05, Hunter H. [email protected] wrote:

<%= link_to “View Cart”, {:controller => ‘store’, :action => ‘view_cart’,
:protocol => ‘https://’, :host => ‘secure.host.com’} %>

I would expect this to generate a https link to another host.

Instead, all I get is:

View Cart

link_to “View Cart”, {:controller => ‘store’, :action => ‘view_cart’,
:protocol => ‘https://’, :host => ‘secure.host.com’, :only_path =>
false}

:only_path is true by default in the scope of ActionView::Helpers (eg.
all views), so :protocol and :host will have no effect unless
:only_path=>false is forced.

Cheers,
JS


http://johansorensen.com
http://theexciter.com

Thanks.

Perhaps a bug should be filed on the documentation? I don’t think this
is
mentioned anywhere.