Validations on money-rails gem -
i have money-rails gem installed , it's working flawlessly. however, there no validations on money objects when create new model record. if try input letters money field, form submission successful, sets value 0. how validations working? have no code actual validation, seeing money-rails on github states has validations included, have tried validates_numericality_of
no avail.
edit yes have read docs extensively, , tried validation option suggested on github.
i have example hope you
monetize :price_cents, :numericality => {:greater_than => 0, :less_than => 10} validates :price, :format => { :with => /\a\d+(?:\.\d{0,2})?\z/ }
just 1 of them (monetize validation) validate numericality stuff , other 1 validate format.
Comments
Post a Comment