TRILHOS: Atributos aninhados no novo método com registro existente
Eu tenho modelos:
Frame.rb
belongs_to :manufacturer, foreign_key: 'model'
accepts_nested_attributes_for :manufacturer, :reject_if => proc { |obj| obj.blank? }
Quando tento criar um novo quadro com o fabricante existente, recebo um erro:
Frame.new({name: 'Name of the frame', manufacturer_attributes: {id:2}})
Erro:
Couldn't find Manufacturer with ID=2 for Frame with ID=