Displaying 1 result from an estimated 1 matches for "parentable_id".
2010 May 25
2
Site Navigation With Polymorphic Has Many Through
...-----Product1
------Product2
----Product3
--Category2
----Product4
--Page1
--Page2
--Page3
This is the current setup:
MODELS
class MenuItem < ActiveRecord::Base
belongs_to :childable , :polymorphic => true
belongs_to :parentable , :polymorphic => true
acts_as_list :scope => :parentable_id
end
class Category < ActiveRecord::Base
has_one :parent_menu_item , :as => :parentable , :class_name =>
''MenuItem''
has_many :child_menu_items , :as => :childable , :class_name =>
''MenuItem''
has_one :parentable , :through => :parent_...