method

count

Importance_1
count() public

Returns the number of error messages.

person.errors.add(:name, "can't be blank")
person.errors.count # => 1
person.errors.add(:name, "must be specified")
person.errors.count # => 2
Show source
Register or log in to add new notes.