Method: ActiveModel::Errors#attribute_names
- Defined in:
- lib/active_model/errors.rb
#attribute_names ⇒ Object
Returns all error attribute names
person.errors. # => {:name=>["cannot be nil", "must be specified"]}
person.errors.attribute_names # => [:name]
234 235 236 |
# File 'lib/active_model/errors.rb', line 234 def attribute_names @errors.map(&:attribute).uniq.freeze end |