# Link\_to\_remote and SSL problem

**URL:** <https://www.ruby-forum.com/t/link-to-remote-and-ssl-problem/91021>\
**Category:** Rails\
**Created:** [April 3, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/link-to-remote-and-ssl-problem/91021 "2007-04-03T21:45:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [April 3, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/link-to-remote-and-ssl-problem/91021/1 "2007-04-03T21:45:06Z")

</div>

I’m having trouble with link\_to\_remote on an SSL page.

I have a form that includes multiple items (multiple instances of one  
model). I use link\_to\_remote to an RJS function to allow the user to  
delete items. The delete link, which is inside the partial that  
displays an item, looks like this:

\<%= link\_to\_remote ‘Delete’, :url =\> { :action =\>  
‘delete\_item’, :index =\> index } %\>

And it worked great – until I switched the page to SSL. I’m using the  
ssl\_requirement plugin. The page itself works fine, but the delete  
link no longer works. Firebug reports that this is because the  
link\_to\_remote call goes to http:// not https:// and is therefore not  
allowed by the security model.

So I changed the code to:

\<%= link\_to\_remote ‘Delete’, :url =\> { :action =\>  
‘delete\_item’, :index =\> index, :protocol =\> ‘https://’ } %\>

But it still generates a plain http request. I tried adding :only\_path  
=\> false but that didn’t do it either.

I’d really appreciate any pointers on this.

Thanks,

Michael

P.S. Curiously, there is a very similar ‘add\_item’ link:

\<%= link\_to\_remote “Add item”, :url =\> { :action =\> ‘add\_item’, :index  
=\> index } %\>

And this works fine. Why would this one generating an https: request  
and the other one not?
