Re: [Rails] accepts_nested_attributes_for with has_many => :through

2010-02-06 Thread tommy xiao
have a look: http://railscasts.com/episodes/73-complex-forms-part-1 http://railscasts.com/episodes/73-complex-forms-part-2 http://railscasts.com/episodes/73-complex-forms-part-3 2010/2/6 acreadinglist > I have two models, links and tags, associated through a 3rd model, > link_tags. I added the

[Rails] accepts_nested_attributes_for with has_many => :through

2010-02-06 Thread acreadinglist
I have two models, links and tags, associated through a 3rd model, link_tags. I added the following to my link model, has_many :tags, :through => :link_tags has_many :link_tags accepts_nested_attributes_for :tags, :allow_destroy => :false, :reject_if => proc { |attrs| attrs.all? { |k, v|