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

Popular posts from this blog

c# - ItextSharp font color issue in ver 5.5.4+ -

jquery - Multiple issues with pushstate: history, loading, calling functions -

ios - retrievePeripherals deprecated in IOS7 how to substitude it with retrievePeripheralsWithIdentifiers -