Problem: link_to_remote with :method => :delete in Safari

I have just come up against a really frustrating issue with link_to_remote in Safari. What makes it more frustrating is the Rails dev site being down making it impossible to submit a ticket.
When setting :method => :delete on the link_to_remote helper, Safari sends a GET request rather than a DELETE. Firefox is fine with it.


no route found to match "/projects/13;delete" with {:method=>:get}

If anyone knows of a way to fix this I would be most grateful.

8 Replies to “Problem: link_to_remote with :method => :delete in Safari”

  1. Is it setting method:’delete’ in the Ajax.Request object? If so, that may not work in Safari so you’ll have to do:
    < %= link_to_remote 'text', :url => foo, :with => “‘_method=delete'” %>
    Not the deliberate double quotes in there. This sets the _method=delete param automatically.

  2. Rick: You are a STAR!! – This has been driving me mad, tried all kinds of hackery to get around it. Do you know if this is an issue with Safari or Prototype?
    This fix should probably be written into the link_to_remote helper. The dev site is down at the mo so I can’t submit a patch.

Leave a Reply

Your email address will not be published. Required fields are marked *