method

attribute_names

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveModel::Errors
attribute_names() public

Returns all error attribute names

person.errors.messages        # => {:name=>["cannot be nil", "must be specified"]}
person.errors.attribute_names # => [:name]
Show source
Register or log in to add new notes.