ri > ActiveModel::Naming

= ActiveModel::Naming

(from /home/chedong/.local/share/rdoc)
------------------------------------------------------------------------
== Active Model Naming

Creates a model_name method on your object.

To implement, just extend ActiveModel::Naming in your object:

  class BookCover
    extend ActiveModel::Naming
  end

  BookCover.model_name.name   # => "BookCover"
  BookCover.model_name.human  # => "Book cover"

  BookCover.model_name.i18n_key              # => :book_cover
  BookModule::BookCover.model_name.i18n_key  # => :"book_module/book_cover"

Providing the functionality that ActiveModel::Naming provides in your
object is required to pass the Active Model Lint test. So either
extending the provided method below, or rolling your own is required.
------------------------------------------------------------------------
= Class methods:

  param_key
  plural
  route_key
  singular
  singular_route_key
  uncountable?

= Instance methods:

  model_name

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-29 14:43 @216.73.217.111
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!