Tom Tom wrote:
ok, what i need and dont know know how to do is:
@result = Category.roots
#gives me 3, because i have 3 records with parent_id=NULL, what is fine
You might just want to do Category.find :all, :order => 'lft', which
will give you all the records in the right order. Alternatively, you
could make all 3 current root elements into children of a new, single,
root, and then just fetch all descendants of the new root.
again, i want a xml-structure of all root-records with their children,
and their children , and their children etc....
i can do it if i have only 1 result, but dont know how to build the xml
if i have, lets say 30+ roots...