instance method
attribute_names
Ruby on Rails 7.0.10
Since v6.0.6Signature
attribute_names()
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"]
Source
# File activemodel/lib/active_model/attributes.rb, line 41
def attribute_names
attribute_types.keys
end
Defined in activemodel/lib/active_model/attributes.rb line 41
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Attributes::ClassMethods