ruby on rails - Validation errrors: how to get rid of "Validation failed: "? -
whenever do
rescue exception => e flash[:error] = e.message the e.message contain "validation error:" string , object
example:
validation failed: price "message:", price "message"
how tell rails want message? , not other parts of validation error displayed?
you can data want #errors attribute of model trying save. there potentially multiple validation errors (not one).
see http://api.rubyonrails.org/classes/activemodel/errors.html
Comments
Post a Comment