If I put this code in the index.html.erb view, it works:
<%= sortable_element :people_list, :url => {:action => "sort" }, :tree
=> true %>
I thought that I should be able to put this code into a file called
index.js.rjs:
page.sortable 'people_list', :url => { :action => 'sort' }, :tree =>
true
This doesn't work, however. Is there something else I need to do?
Did you notice this warning from the Rails API:
Important: For this to work, the sortable elements must have id
attributes in the form "string_identifier". For example, "item_1".
Only the identifier part of the id attribute will be serialized.
If 'people_list' is a <ul>, then each <li> should probably have an id
like 'person_n'. Have you got that?