> However, this brought me an idea: I hope I got this right of course,
> but based on my perception of a nested set, I could get all
> descendants, order them by "lft" and do something like
> descendants.each do |attribute| and send along the attribute's id. If
> the parent_id of the next attribute matches this id, it's a child,
> otherwise it's a sibling. However, this makes awesome nested set a
> very limited plugin and if this is the only way this could be done, it
> could really do with some improvements.
>
> I will first try this in my views, so I'll get back to you on this,
> but it's not pretty and I do not prefer to do it this way.

I've tried this and it won't work. The only way I can get this to work
properly is by using attribute.level, but that, again, generates a
query for every partial (which means even more queries than before).
That's not the way to go. I'm stuck and I have to move on, so for the
time being I'll use my old acts_as_tree with acts_as_list model,
simply because it's more suitable for repositioning within parents (I
won't be doing anything else). If anyone can come up with a better
solution, you're free to share it and it probably won't be very hard
to convert to it, so please think along :)

Thank you both again!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to