block_portlet_id = $("#new_portlet_form_inline").closest(".block_portlets").data('block_id');

$("#new_portlet_form_inline").replaceWith("<%= escape_javascript(render(@portlet)) %>");




update_block_portlet_order(block_portlet_id);


$(".block_portlets").sortable("enable");

<%= flash_js %>