> params[:item].each {|id, hash| Item.find(id).update_attributes(hash)}
>
> Which should convert the serialized data into the acts_as_nested_set. Make
> sense?

It does. I'm wondering what happens if you have a very large tree
(+10.000 nodes) and you load part of it on demand. In this situation,
the whole tree is never loaded at once for scalability reasons, so it
is not possible to compute the left and right values client side.
Maybe it's a specific use case. If so, another serializer could be
written that only sends parent_id information for the loaded tree ?

I never used act_as_nested_set, but my implementation allows you to
add nodes in an arbitrary order, then you can "rebuild" the tree. It
is also possible to add a node anywhere without rebuilding the nested
set.

There is an article on the difference between "adjacency list" (parent
id) and what they call "modified preorder tree traversal" (left +
right) :
http://www.sitepoint.com/article/hierarchical-data-database/2

Something else that came to mind : is it possible to allow other
parameters to be sent? Like a 'modified' flag, so we can only update
the DB with modified nodes.

All this is very cool to have in jquery, thanks a lot for making it happen!

-- 
Philippe Jadin
Thinkedit, a flexible
data and content
management system :
http://www.thinkedit.org

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to