# Rails 3 UJS and delete action

**URL:** <https://www.ruby-forum.com/t/rails-3-ujs-and-delete-action/189400>\
**Category:** Rails\
**Created:** [May 31, 2010, 9:52am UTC](https://www.ruby-forum.com/t/rails-3-ujs-and-delete-action/189400 "2010-05-31T09:52:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 31, 2010, 9:52am UTC](https://www.ruby-forum.com/t/rails-3-ujs-and-delete-action/189400/1 "2010-05-31T09:52:33Z")

</div>

Hi,

I ve got a question concerning delete actions in the new rails 3 world  
with unobtrusive javascript.

How may I perform an “ajax” delete in a list of products.

if attribute data-method is specified rails.js handleMethod is  
called,  
which adds csrf params into a hidden form and form.submit is called.  
Works great, but form.submit is nt performed as an ajax request.

Using data-remote instead of data-method would nt add csrf params.

What s the best approach to achieve what I need?

Thanks a lot in advance.

–  
Volker
