views:

17

answers:

0

Whenever I click the serialize button to return results I'll get something like "tree_list[0][id]=2&tree_list[1][id]=3...".

View:

<a href="#" onclick="alert(Sortable.serialize('tree_list'));return false">Serialize</a>
<ul id="tree_list">
<%= render :partial => "tree_item", :collection => @tree_items %> 
</ul>
<%= sortable_element('tree_list', :url => {:action => 'update_navigation_item_rank_ajax'}, :tree => true) %>

Partial tree_item:

<li class="item" id="item_<%=tree_item.id%>">
 <p>
  <%= tree_item.name %>  <a href="/admin/tree/edit/<%= tree_item.id %>" class="submodal-600-400">Edit Tree Item</a>
 </p>
 <% if tree_item.has_children? %>
    <ul>
      <%= render :partial => "tree_item", :collection => tree_item.children %>
    </ul>
   <% else %>
    <!-- placeholder-->
    <ul><li>&nbsp;</li></ul>
   <% end %>
</li>