# REST, Internet Explorer and the banned DELETE method

**URL:** <https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276>\
**Category:** Rails\
**Created:** [March 17, 2010, 11:25am UTC](https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276 "2010-03-17T11:25:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [March 17, 2010, 11:25am UTC](https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276/1 "2010-03-17T11:25:22Z")

</div>

Hi all

As we all know, in REST the ResourceController#delete action is called  
by calling “/resources/:id” with a delete method. But, the delete  
method is not supported in IE. This seems like a problem to me. How do  
people get around this, typically? I can think of various ways around  
it but they all seem a bit bodgy and i’d like to know some other  
approaches or even if there’s something really obvious that i’m missing.

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [March 17, 2010, 11:37am UTC](https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276/2 "2010-03-17T11:37:38Z")

</div>

Hi,  
You just cat you following in your view:  
\<%= link\_to ‘Destroy’, photo, :confirm =\> ‘Are you sure?’, :method  
=\> :delete %\>  
and it appear in browser to that:  
[Destroy](https://www.ruby-forum.com/photos/%2051)

as you can see its still post, but it has hidden input that tells your  
controller about delete.

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [March 17, 2010, 11:39am UTC](https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276/3 "2010-03-17T11:39:58Z")

</div>

\*your just CAN ADD (sorry for this typo)…

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [March 17, 2010, 11:59am UTC](https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276/4 "2010-03-17T11:59:16Z")

</div>

DmitryPush wrote:

> Hi,  
> You just cat you following in your view:  
> \<%= link\_to ‘Destroy’, photo, :confirm =\> ‘Are you sure?’, :method  
> =\> :delete %\>  
> and it appear in browser to that:  
> [Destroy](https://www.ruby-forum.com/photos/%2051)
> 
> as you can see its still post, but it has hidden input that tells your  
> controller about delete.

Ah yes, of course, i had the feeling that rails handled this with a bit  
of subterfuge but couldn’t remember quite how. I actually tried this  
with a link\_to\_remote and the generated html was just a call to  
jQuery.ajax with the delete method, just as i’d done it already, rather  
than the code you posted up. I wonder if this is an issue with the  
jrails plugin, which overrides the javascript generated by rails’ remote  
helpers.

I’m actually doing it in javascript (in a jQuery.ajax call) anyway, so  
lets see if changing the method to post and adding “\_method=delete” to  
the data has the same effect…yes it does. Great, thanks Dmitry!

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [March 17, 2010, 11:47am UTC](https://www.ruby-forum.com/t/rest-internet-explorer-and-the-banned-delete-method/185276/5 "2010-03-17T11:47:35Z")

</div>

by the way, the same story about PUT

..........
