How to call destroy from jquery

Folks
Does anyone know how i could call destroy on a controller using rails
3.1 from a jquery function. Im just trying to find some examples online
and cant seem to find anything that shows this. Thanks

On Feb 15, 3:51pm, brent brent [email protected] wrote:

Folks
Does anyone know how i could call destroy on a controller using rails
3.1 from a jquery function. Im just trying to find some examples online
and cant seem to find anything that shows this. Thanks


Posted viahttp://www.ruby-forum.com/.

I think this will work:

$.ajax({
type: ‘delete’
[…other stuff…]
});

Regards.

you might want to check out Railscasts.com episodes 196 and 197. He
uses a link to do that – not sure if that is what you want, but it is
good starting point.