Add to the sorted list using Ajax, and in order to get the Scriptaculous effects that can be used after the addition, the only way I found is to re-execute the sortable_element.
Can anyone suggest a better way to do this, with full code this is a hack:
><%= link_to_remote "Add",
:url => { :controller => "pages", :action => "add_fragment", :pid => pid, :index => index },
:complete => "eval(decodeURIComponent(#{sortable_element 'frag_list', :url => sort_frag_pages_path, :complete => visual_effect(:highlight, 'frag_list'), :handle => 'handle'}).gsub('//',''));" %>
source
share