# Restful droppable delete

**URL:** <https://www.ruby-forum.com/t/restful-droppable-delete/121055>\
**Category:** Rails\
**Created:** [November 23, 2007, 9:44am UTC](https://www.ruby-forum.com/t/restful-droppable-delete/121055 "2007-11-23T09:44:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [November 23, 2007, 9:44am UTC](https://www.ruby-forum.com/t/restful-droppable-delete/121055/1 "2007-11-23T09:44:02Z")

</div>

I have a list of pages from which I want to delete one. This I want to  
do with draggable/droppable(trash can like). Which, strange enough,  
does not work.

This does work:  
{{{  
link\_to\_remote(“delete”, :url =\> project\_wiki\_page\_path(@project,  
page), :method =\> :delete, :title =\>project\_wiki\_page\_path(@project,  
page))  
}}}

But this doesn’t:

{{{

}}}  
Note that we are using plain prototype here because at the moment the  
page is generated on the server we do not yet know what the URL might  
be.

They both give exactly(!) the same parameters in the generated  
request, and they both invoke destroy. However, the second function  
invokes the show method with the id of the page that was deleted, thus  
giving an error, we just deleted that item! It doesn’t obey the  
redirect.

The destroy function looks like this:  
{{{  
def destroy  
@page = @project.pages.find(params[:id])  
@page.destroy  
redirect\_to(index)  
end  
}}}

We are using Scriptaculous version 1.8, Prototype version 1.6 and  
Rails Edge.
