Question about Drag-and-Drop element

Hi,

I am testing the helper “drop_receiving_element” refer to the ROR book.
the sample code like this :

<%= drop_receiving_element(‘completed_todos’,
:accept => ‘pending_todo’,
:complete => “$(‘spinner’).hide();” ,
:before => “$(‘spinner’).show();” ,
:hoverclass => ‘hover’,
:with => “‘todo=’ + encodeURIComponent(element.id.split(’_’).last())” ,
:url => {:action=>:todo_completed, :id=>@user})%>

When I test this code, it will block the following action(here is
:todo_completed). If you refresh the page, nothing changed. But when you
drag the item, the effect looks like that item really be draged to
another list and stay there.

If I removed the :complete and :before option, it will invoke the action
as expect. But the item will go to its original location after drop.
When I refresh the page, I can see the change.

What does $(‘spinner’).hide(); do in detail? I think the problem it
something about “$(‘spinner’)”. Any idea will be appreciated

thanks
Edwin