Type:
Module

The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without, and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept in inflections.rb.

The Rails core team has stated patches for the inflections library will not be accepted in order to avoid breaking legacy applications which may be relying on errant inflections. If you discover an incorrect inflection and require it for your application or wish to define rules for languages other than English, please correct or add them yourself (explained below).

safe_constantize
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector

safe_constantize(camel_cased_word) Instance Public methods Tries to find a constant

2025-01-10 15:47:30
uncountable
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector/ActiveSupport::Inflector::Inflections

uncountable(*words) Instance Public methods Add uncountable words that shouldn't

2025-01-10 15:47:30
constantize
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector

constantize(camel_cased_word) Instance Public methods Tries to find a constant

2025-01-10 15:47:30
humanize
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector

humanize(lower_case_and_underscored_word, options = {}) Instance Public methods Capitalizes

2025-01-10 15:47:30
titleize
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector

titleize(word) Instance Public methods Capitalizes all the words and replaces

2025-01-10 15:47:30
ordinalize
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector

ordinalize(number) Instance Public methods Turns a number into an ordinal string

2025-01-10 15:47:30
irregular
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector/ActiveSupport::Inflector::Inflections

irregular(singular, plural) Instance Public methods Specifies a new irregular

2025-01-10 15:47:30
acronym
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector/ActiveSupport::Inflector::Inflections

acronym(word) Instance Public methods Specifies a new acronym. An acronym must

2025-01-10 15:47:30
classify
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector

classify(table_name) Instance Public methods Create a class name from a plural

2025-01-10 15:47:30
new
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Inflector/ActiveSupport::Inflector::Inflections

new() Class Public methods

2025-01-10 15:47:30