Dropping and Sorting with AJAX and script.aculo.us - Droppables with Ajax (Page 2 of 4 )
All the options specified in the previous section are available whether you create your droppable with JavaScript (Droppables.add) or the Rails helpers (drop_receiving_elementanddrop_receiving_element_js). However, when created with the helpers, some additional options are available. Namely, all thelink_to_remoteoptions, such asupdate andurl(described in Chapter 3), are also available, and will be used to create anonDropcallback function for doing Ajax calls with droppables. For example:
Notice that the:urloption points to areceive_dropaction, so we’ll need to define that in chapter4_controller.rb:
def receive_drop render :text => "you dropped element id #{params[:id]}" end
Unless overridden by the:withoption, thedrop_receiving_elementAjax call will automatically include the ID of the draggable as theidparameter of the request.