dracos
1
Hi,
If I have a db table
categories
- id
- name
- parent_id
- position
is it alright to have the Category model act_as_tree and for each
level act_as_list?
class Category < ActiveRecord::Base
acts_as_tree :order => :position
acts_as_list :scope => :parent_id
end
Thanks,
Peter
dracos
2
Hi, Peter,
yes you could do that. I’m doing it in one of my models without a
problem.
Best Regards
Jan P.
dracos
3
I had some trouble with this when I tried it. See:
http://forum.textdrive.com/viewtopic.php?id=7639
I still haven’t figured out how to get it to work right. If you get it
to work, let me know.
Peter M. wrote:
Hi,
If I have a db table
categories
- id
- name
- parent_id
- position
is it alright to have the Category model act_as_tree and for each
level act_as_list?
class Category < ActiveRecord::Base
acts_as_tree :order => :position
acts_as_list :scope => :parent_id
end
Thanks,
Peter