instance method
size
Ruby on Rails 3.1.12
Since v2.2.3Signature
size()
Returns the number of error messages.
p.errors.add(:name, "can't be blank") p.errors.size # => 1 p.errors.add(:name, "must be specified") p.errors.size # => 2
Source
# File activemodel/lib/active_model/errors.rb, line 162
def size
values.flatten.size
end
Defined in activemodel/lib/active_model/errors.rb line 162
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Errors