Restful droppable delete

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:

{{{ <script type="text/javascript">Droppables.add("drop_wp", { onDrop:function(element){   new Ajax.Request(''+element.title, {asynchronous:true, evalScripts:true, method:'delete'});    } }); </script> }}} 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.