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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -