Rails 3.1.x - jquery

drag_drop.js
$(function() {
$( "[id^=moveable]" ).draggable();
  $( "#droppable2" ).droppable({
    drop: function( event, ui ) {
      $( this )
       .addClass( "ui-state-highlight" )
       $.post( "groups/add_member/", { "add": ui.draggable.text() }, 
function(data) {
         $('#member_management').html(data) } );
    }
  });
});

The controller does "render :partial => 'memberships'" and my 
memberships.js.erb has
$('#memberships').load("<%= escape_javascript(render(:partial => "memberships", 
:object => @group)) %>");

Works - well, I still need a way to pass @group instance variable in the 'post' 
string back to controller but in the meantime, I am stuck in that after the 
first drag/drop/update I can't do more drag and drop apparently because the 
drag_drop.js code needs to run again after the partial refresh.

How do I get this to execute again or must I necessarily embed the script in 
the memberships.js.erb ?

-- 
Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ craig.wh...@ttiltd.com
1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ www.ttiassessments.com 

Need help communicating between generations at work to achieve your desired 
success? Let us help!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to