The problem is what Frame.newis the new record, when ActiveRecord reaches the parameter manufacturers_attributes, it searches for an association manufacturers_attributesfor Frame.new, which is unsaved and therefore does not have an identifier with which to search.
I recommend starting with an existing record manufacturerand simply creating such a frame manufacturer.frames.create(frame_params)(assuming a one-to-many relationship).
, , manufacturer_attributes :
accepts_nested_attributes_for :manufacturer
def manufacturer_attributes=(attributes)
if attributes['id'].present?
self.manufacturer = Manufacturer.find(attributes['id'])
end
super
end
, , manufacturer_attributes , .