I make an ajax call to edit a form by doing this:
$(".edit_meeting_button").live("click", function(){
var mid = $(this).attr("id");
$.ajax({type:'GET', url: '/meetings/' + mid + '/edit', success: function(data) {
$(".right-box").html(data);
}});
$(".display_zone").html("<%= escape_javascript(render :partial => "display_attendees", :locals => {:all => @atendees}) %>");
return false;
})
I get the desired action where the div ".right-box" displays the form to edit but the next call to update the ".display_zone" fails to update with a new set of @attendees which I processed in the controller when I called the edit form. So I want ".display_zone" to show me the new attendees but it does not. I guess this would work but I wanted to ask if there was a more slick (and correct) way of achieving this.
$(".edit_meeting_button").live("click", function(){
var mid = $(this).attr("id");
$.ajax({type:'GET', url: '/meetings/' + mid + '/edit', success: function(data) {
$(".right-box").html(data);
}});
$.ajax({type:'GET', url: '/meetings/update_display' + mid, success: function(data) {
$(".display_zone").html(data);
}});
return false;
})
Thanks!