Skip to content
ChaosSteffen edited this page Sep 14, 2010 · 2 revisions

Dawanda categories are organized in a tree. To get the top level of categories, you can call:

>> category = Dawanda::Category.top.first
=> #<Dawanda::Category:0x138c5d8 @result={"product_count"=>0, "name"=>"2000", "id"=>218,
>> category.parent
=> nil
>> category.children
=> [#<Dawanda::Category:0x1395cb4 @result={"product_count"=>4851, "name"=>"2001", "id"=>222, ...
>> category.product_count
=> 100
Clone this wiki locally