Multiple sub categories (parent-child)


#1

hi.

base from the cookbook example, where each categories can have many
recipes,

id like the categories to have multiple sub categories, unlimited
levels.

please show some code, as i am new to Ruby and Ruby On Rails.

thanks


#2

Do you want the categories to behave like a tree? If so, check out
acts_as_tree.

http://api.rubyonrails.org/classes/ActiveRecord/Acts/Tree/ClassMethods.html#M000485

-Jonathan.