# Reg:act\_as\_tree

**URL:** <https://www.ruby-forum.com/t/reg-act-as-tree/169654>\
**Category:** Rails\
**Created:** [June 6, 2009, 10:34am UTC](https://www.ruby-forum.com/t/reg-act-as-tree/169654 "2009-06-06T10:34:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@charan](https://www.ruby-forum.com/u/charan)\
**Post date:** [June 6, 2009, 10:34am UTC](https://www.ruby-forum.com/t/reg-act-as-tree/169654/1 "2009-06-06T10:34:12Z")

</div>

HI

am using acts\_as\_tree and yui to generate tree structure,  
as per the DB is consern for acts\_as\_tree,the parent and child nodes  
are from one table…

i have two different table like

## region table

pk name  
1 hyderabad  
2 chennai  
3 bangalore

area tabel  
id name fk  
1 madhapur 1  
2 hi-tech 1  
3 kondapur 1  
4 adayar 2  
5 ECR road 2  
6 anna nagar 2  
7 whitefiled 3  
8 MGM 3

so i need name in region table as root node and the respective fk  
names in area table as child nodes(i dont need subchild node )…

how can i use acts\_as\_tree for this table,are is there an alternative  
to do this
