# Request type error thrown on delete request

**URL:** <https://www.ruby-forum.com/t/request-type-error-thrown-on-delete-request/158023>\
**Category:** Rails\
**Created:** [January 18, 2009, 2:46am UTC](https://www.ruby-forum.com/t/request-type-error-thrown-on-delete-request/158023 "2009-01-18T02:46:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [January 18, 2009, 2:46am UTC](https://www.ruby-forum.com/t/request-type-error-thrown-on-delete-request/158023/1 "2009-01-18T02:46:48Z")

</div>

For some odd reason when I make javascript delete requests the destroy  
is performed, but then I get an error message back saying that only get,  
delete and put requests are allowed.

Here is some global js that binds all the delete links within tables

function bind\_table\_destroys() {  
$(“table.data a.destroy”).click(function() {  
if (!confirm(“This item will be permanently removed”))  
return false

```
var link = $(this)
$.post(this.href + ".js", "_method=delete", function() {
  // remove the row from the table
  link.parent().parent().remove() // a->td->tr
})
return false

```

})  
}

The routing seems good since the destroy action is called. To be honest  
I wouldn’t be able to tell that an error occured unless I read the  
respnose text within firebug.

Does anyone have any clues to the problem?

Thanks for the help
