lundi 23 janvier 2017

rails Validate has_many through

I'm trying to validate has_many through association using the id or the validade associated method but, the log spits out!

someone have any idea how to validate a has_many through? thank's

syntax error, unexpected '[', expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END if !halted && true && (validation_context == :[:update])

validates :image_id, :size_id, :color_id,  presence: true, :on => [  :update ]

validates_associated :images, :sizes, :colors, presence: true, :on => [  :update ]

Aucun commentaire:

Enregistrer un commentaire