method

attribute_names

Importance_1
v7.1.3.4 - Show latest stable - 0 notes - Class: ClassMethods
attribute_names() public

Returns an array of attribute names as strings.

class Person
  include ActiveModel::Attributes

  attribute :name, :string
  attribute :age, :integer
end

Person.attribute_names # => ["name", "age"]
Show source
Register or log in to add new notes.