rails-models: update error helpers.

This commit is contained in:
Rico Sta. Cruz 2012-10-11 17:05:38 +08:00
parent 9fa340f6c8
commit c4634c0cf3
1 changed files with 8 additions and 0 deletions

View File

@ -171,6 +171,14 @@ Validation
end
end
### Errors
record.errors.valid? #=> false
record.errors #=> { :name => ["can't be blank"] }
record.errors.messages #=> { :name => ["can't be blank"] }
record.errors[:name].any?
API
---