# Having Trouble With :protocol and :host with link\_to

**URL:** <https://www.ruby-forum.com/t/having-trouble-with-protocol-and-host-with-link-to/48264>\
**Category:** Rails\
**Created:** [November 12, 2005, 9:40pm UTC](https://www.ruby-forum.com/t/having-trouble-with-protocol-and-host-with-link-to/48264 "2005-11-12T21:40:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lists](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cdc98d/32.png) [@lists](https://www.ruby-forum.com/u/lists)\
**Post date:** [November 12, 2005, 9:40pm UTC](https://www.ruby-forum.com/t/having-trouble-with-protocol-and-host-with-link-to/48264/1 "2005-11-12T21:40:47Z")

</div>

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](http://secure.host.com)’} %\>

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

Instead, all I get is:

[View Cart](https://www.ruby-forum.com/store/view_cart)

Have I misunderstood the url\_for specs?

Thanks,  
Hunter
