instance method
to_a
Ruby on Rails 3.0.20
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 134
def to_a
full_messages
end
Defined in activemodel/lib/active_model/errors.rb line 134
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Errors