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