RAILS: atributos anidados en un nuevo método con registro existente
Tengo modelos:
Frame.rb
belongs_to :manufacturer, foreign_key: 'model'
accepts_nested_attributes_for :manufacturer, :reject_if => proc { |obj| obj.blank? }
Cuando intento crear un nuevo marco con el fabricante existente, aparece un error:
Frame.new({name: 'Name of the frame', manufacturer_attributes: {id:2}})
Error:
Couldn't find Manufacturer with ID=2 for Frame with ID=