Request type error thrown on delete request


#1

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