1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

p.errors.full_messages is a little more human readable

This commit is contained in:
Jason Noble 2011-11-13 01:32:26 -07:00
parent fc8f0a85b5
commit cb552f807e

View file

@ -731,10 +731,8 @@ After the console loads, you can use it to work with your application's models:
updated_at: nil>
>> p.save
=> false
>> p.errors
=> #<OrderedHash { :title=>["can't be blank",
"is too short (minimum is 5 characters)"],
:name=>["can't be blank"] }>
>> p.errors.full_messages
=> ["Name can't be blank", "Title can't be blank", "Title is too short (minimum is 5 characters)"]
</shell>
This code shows creating a new +Post+ instance, attempting to save it and