Creating Dynamic Tree Menu in Rails

Hello all,
I need a good technique to create a tree menu based off pages in a
database with RoR. So, pages would look something like this in the db:

pages (

Obviously, the parent_id would be 0 or null for the top-level pages
and any sub-pages would have the id under parent_id. What I'm looking
for as far as a read-out is a simple unordered-list with sub-lists
under the parent's list item.. so:

              <li>Child 1</li>
              <li>Child 2</li>

If I can have it be recursive that would also be great.


Have a look into acts_as_tree.

Have a look here