instance method
to_a
Ruby on Rails 4.1.16
Since v2.2.3Signature
to_a()
Returns an array of error messages, with the attribute name included.
person.errors.add(:name, "can't be blank") person.errors.add(:name, "must be specified") person.errors.to_a # => ["name can't be blank", "name must be specified"]
Source
# File activemodel/lib/active_model/errors.rb, line 196
def to_a
full_messages
end
Defined in activemodel/lib/active_model/errors.rb line 196
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Errors