Displaying 1 result from an estimated 1 matches for "page_categori".
Did you mean:
page_category
2009 Apr 12
0
rails 2.3 nested forms with has_many through checkboxes
...age via checkboxes.
Hopefully this makes sense and can actually be done, I''d rather not
have to go to another controller/form just to create and edit page
categories.
class Page < ActiveRecord::Base
has_many :category_items, :as => :item, :dependent => :destroy
has_many :page_categories, :through => :category_items, :source
=> :category, :source_type => "PageCategory", :uniq => true
accepts_nested_attributes_for :page_categories, :allow_destroy =>
true, :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }
end
class PageCategory < ActiveR...