Displaying 2 results from an estimated 2 matches for "actsastree".
Did you mean:
acts_as_tree
2008 Dec 07
1
How to describe self join in a model
Hi ,
I am new to rails, and i need to know one thing, i have a table
called Categories and i want to self join it in such a way , that one
category could be a parent of many categories, but could be child of
only one category.
Please tell me how to tell rails , in my Category Model, does the
following work for me ?
class Category
belongs_to :category
has_many :categories
end
2006 Jun 17
5
Having trouble listing tiers of categories
I have categories and sub-categories in a table called "categories".
Every row has a "parent" field to note if the entry is the sub-category
of another (never goes deeper than 1 level).
So there might be something like this:
id | name | parent
1 Dog 0
2 Pug 1
3 Siamese 5
4 Shih Tzu 1
5 Cat 0
6 Wiener Dog 1
7 Persian