Active Record acts_as_tree and leaf depth

Using acts_as_tree, is it possible to get information of the depth a
tree leaf in relation to the root? Or is available to derive
information to save in the way “position” can be derived and saved for
acts_as_list.

Hi Tony,

Le 25 déc. 06, à 08:03, Tony K. a écrit :

Using acts_as_tree, is it possible to get information of the depth a
tree leaf in relation to the root? Or is available to derive
information to save in the way “position” can be derived and saved for
acts_as_list.

It cannot be done simply. Check nested_set instead, where this info is
simple to retrieve.

Jean-Christophe M.

Better Nested Set for rails:
http://opensource.symetrie.com/trac/better_nested_set

Thanks for the response. I will look in nested_set.

Can a table using acts_as_tree be used in combination with single
table inheritance as described in the book Agile Web D. with
Rails, pg. 263?