Hi,
I am trying to create a Ruby on rails application using the integrated scriptaculous drag and drop effect.
Since I'm new to the ruby language I ended up with this code while viewing many documentation but can't understand why the controller code is not executed.
In the html.erb page the origin div
<% for therm in @therms %>
<tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>">
<td>
<% therm_id = "therm_#{therm.id}" %>
<li class="origin" id='<%= therm_id %>'><%= therm.id %></li>
</td>
The target
<%= image_tag "dragtrash.png", :id=>'trash'%>
And I identify the drop target
<%= drop_receiving_element('trash',
:accept => 'origin',
:complete => "$('spinner').hide();" ,
:before => "$('spinner').show();" ,
:hoverclass => 'hover',
:with => "'paramid=' + encodeURIComponent(element.id.split('_').last())" ,
:url => {:action=>:trash_therm})%>
And finally in my controller
def trash_therm
redirect_to(:action => 'create')
end
When I drop the item in the target the dropped content sticks to the target. If the target didn't "catch" the item it would revert to it's original position. I don't understand why the code in the controller is not executed.
Thank in advance for help