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).

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

demodulize(path) Instance Public methods Removes the module part from the expression

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

singularize(word, locale = :en) Instance Public methods The reverse of pluralize

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

instance(locale = :en) Class Public methods

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

parameterize(string, sep = '-') Instance Public methods Replaces special characters

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

clear(scope = :all) Instance Public methods Clears the loaded inflections within

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

dasherize(underscored_word) Instance Public methods Replaces underscores with

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

inflections(locale = :en) Instance Public methods Yields a singleton instance

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

singular(rule, replacement) Instance Public methods Specifies a new singularization

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

tableize(class_name) Instance Public methods Create the name of a table like

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

foreign_key(class_name, separate_class_name_and_id_with_underscore = true) Instance Public methods

2025-01-10 15:47:30