Flowdock
method

model_name

Importance_1
Ruby on Rails latest stable (v4.2.1) - 0 notes - Class: ActiveModel::Naming
model_name() public

Returns an ActiveModel::Name object for module. It can be used to retrieve all kinds of naming-related information (See ActiveModel::Name for more information).

class Person
  include ActiveModel::Model
end

Person.model_name.name     # => "Person"
Person.model_name.class    # => ActiveModel::Name
Person.model_name.singular # => "person"
Person.model_name.plural   # => "people"
Show source
Register or log in to add new notes.