instance method
each
Ruby on Rails 8.0.4
Since v2.2.3Signature
each(&block)
Iterates through each error object.
person.errors.add(:name, :too_short, count: 2)
person.errors.each do |error|
# Will yield <#ActiveModel::Error attribute=name, type=too_short,
options={:count=>3}>
end
Source
# File activemodel/lib/active_model/errors.rb, line 67
Defined in activemodel/lib/active_model/errors.rb line 67
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Errors