Using nestedSortable with Rails Ancestry

brandonjmckay edited this page Mar 11, 2013 · 3 revisions
Clone this wiki locally

I'm trying to incorporate nested sortable with my Rails 3 app. I'm using the Ancestry gem currently.

Having difficulty finding out how to create a proper update controller that captures the parent_id and updates the tree with that value.

Is it better to use serialize, or toArray?

This is what I have in my controller now:

def sort
    Category.update_all({parent_id: params[:parent_id].to_i})
    render nothing: true
end

Do you have any tips? Thanks