Managing Hierarchical Data

Hello,

I am in the process of trying to date hierarchical data in a MySQL
database and convert it into a treeview view JS scripting. As a beginner
to ROR there are still many unknown things to me, and handling this sort
of data is one of them. My question is this: Is there any built in
functionality for handling hierarchical data (via a MySQL DB) in
Rails/Ruby? If there is can someone please explain it or link to
documentation on it? That would be of great help, thanks.

  • Josh

On Dec 9, 2007 3:10 PM, Josh G. [email protected]
wrote:

Models:
acts_as_nested_set
acts_as_list
acts_as_tree
http://www.oreillynet.com/ruby/blog/2006/07/treemap_on_rails.html

Controllers:
http://pezra.barelyenough.org/blog/2007/07/hierarchical-resources-in-rails/

Do any of those help? You could also simply setup your models
appropriately
and use some type of parent_id as a foreign key.

Regards,
Michael G.

Michael G. wrote:

On Dec 9, 2007 3:10 PM, Josh G. [email protected]
wrote:

Models:
acts_as_nested_set
acts_as_list
acts_as_tree
http://www.oreillynet.com/ruby/blog/2006/07/treemap_on_rails.html

Controllers:
http://pezra.barelyenough.org/blog/2007/07/hierarchical-resources-in-rails/

Do any of those help? You could also simply setup your models
appropriately
and use some type of parent_id as a foreign key.

Regards,
Michael G.

Somewhat, though not really. Essentially what I am trying to build is a
hierarchical subject list, like how you might navigate a site. For
instance you select “Toys” and it drops down to list the sub-groups
“electronic” and “mobile”. I was simply wondering if there were any
tools to help organize this data so that creating such a list would be
much more simpler as I lack the skills to hard code my own version into
the model.