Link_to_remote and SSL problem


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.



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?