Don't validate nested attributes in rails -
i don't want validate & save nested attributes model while saving parent model.
class car has_many :models nested_attributes_for :models end class model belongs_to :car end car = car.create(name: "tata") car.model_attributes({name: "nano"},{name: "vista"}) car.save!
you can try setting :autosave
false, prevent saving nested attributes
class car has_many :models, autosave: false end
Comments
Post a Comment