search for: component_specif

Displaying 1 result from an estimated 1 matches for "component_specif".

2013 Jul 21
4
how to use activemodel collection.build for a has_many :through association
Hi all, In my controller I am doing the following to populate a nested form for a has_many through association: def new @specification = Specification.new Component.find_each.each do |component| @specification.component_specifications.build(:component_id => component.id) end The idea being whenever someone creates or edits a form, it will be populated with all components at that time so that when they save those components that specification will be associated with the newly created specification. The problem...