Displaying 2 results from an estimated 2 matches for "display_children".
2005 Oct 12
2
Help with act_as_nested_set
...add_child(computers, "Software")
add_child(computers, "Hardware")
add_child(fiction, "Mystery")
add_child(fiction, "Romance")
add_child(fiction, "Science Fiction")
def display_children(list)
puts list.map {|child| child.name + "[#{child.id}]" }.join(", ")
end
display_children(root.direct_children) # Fiction, Non Fiction
display_children(non_fiction.direct_children) #Science[129], History[130],
Computers[131]
display_children(non_fiction.all_childre...
2006 Jul 20
3
acts_as_tree
Hello,
I''m trying to create categories that have their own subcategories, and each
subcategory may have its own subcategories, .. and so on.
After some reading, I found out that the best way for creating such a thing
is to use acts_as_tree, but I didn''t find any tutorial or article that
explain this in a clear way. After a lot of work I was finally able to
create categories and