tags:

views:

55

answers:

3

I want to create tree with ruby.

Any link or code ?

I have two tables.

table1 fields

id name desc

table2 fields

id table1_id table1_parent_id

I want to fetch all the descendents for the specific object.

I have 1 row of table1.

t = Table1.first

On the basis of object t I want to fetch all it's children and children of children. So i one root hash many children and that children containing more children. How may i handle that ? I have no idea what's the way i can handle it properly.

A: 

Build a Binary Tree in Ruby. That kind of tree?

Skilldrick
+2  A: 

Ruby tree gem

Martin Broadhurst