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 (
id
parent_id
title
content
)
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:
- Parent
- Child 1
- Child 2
If I can have it be recursive that would also be great.
Thanks