title: Ruby on Rails drag and drop won't work
body: <p>I am trying to create a Ruby on rails application using the integrated scriptaculous drag and drop effect.</p>
  
  <p>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.</p>
  
  <p>In the html.erb page the origin div</p>
  
  <pre><code>   &lt;% for therm in @therms %&gt;
     &lt;tr valign="top" class="&lt;%= cycle('list-line-odd', 'list-line-even') %&gt;"&gt;
  
    &lt;td&gt;
    &lt;% therm_id = "therm_#{therm.id}" %&gt;
    &lt;li class="origin" id='&lt;%= therm_id %&gt;'&gt;&lt;%= therm.id %&gt;&lt;/li&gt;
    &lt;/td&gt;
  </code></pre>
  
  <p>The target </p>
  
  <pre><code>&lt;%= image_tag "dragtrash.png", :id=&gt;'trash'%&gt;
  </code></pre>
  
  <p>And I identify the drop target</p>
  
  <pre><code>&lt;%= drop_receiving_element('trash',
  :accept =&gt; 'origin',
  :complete =&gt; "$('spinner').hide();" ,
  :before =&gt; "$('spinner').show();" ,
  :hoverclass =&gt; 'hover',
  :with =&gt; "'paramid=' + encodeURIComponent(element.id.split('_').last())" ,
  :url =&gt; {:action=&gt;:trash_therm})%&gt;
  </code></pre>
  
  <p>And finally in my controller</p>
  
  <pre><code>   def trash_therm
   redirect_to(:action =&gt; 'create')
     end
  </code></pre>
  
  <p>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.</p>
  
  <p>Thank in advance for help</p>