diff options
author | Jason Noble <github+jasonn@jasonnoble.org> | 2011-11-13 01:32:26 -0700 |
---|---|---|
committer | Jason Noble <github+jasonn@jasonnoble.org> | 2011-11-13 01:32:26 -0700 |
commit | cb552f807e5bb2650791d17b01b6ac67c6023937 (patch) | |
tree | e3134448eef4aff565122b5a748a4f1510b4a35f /railties/guides/source | |
parent | fc8f0a85b5c6869aed3f8d05b15c6b014deb054f (diff) | |
download | rails-cb552f807e5bb2650791d17b01b6ac67c6023937.tar.gz rails-cb552f807e5bb2650791d17b01b6ac67c6023937.tar.bz2 rails-cb552f807e5bb2650791d17b01b6ac67c6023937.zip |
p.errors.full_messages is a little more human readable
Diffstat (limited to 'railties/guides/source')
-rw-r--r-- | railties/guides/source/getting_started.textile | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 1f1976393f..e88d0a7629 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -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 |