ActiveSupport::Inflector::Inflections

class ActiveSupport::Inflector::Inflections

Parent:
Object

A singleton instance of this class is yielded by ActiveSupport::Inflector#inflections, which can then be used to specify additional inflection rules. If passed an optional locale, rules for other languages can be specified. The default locale is :en. Only rules for English are provided.

ActiveSupport::Inflector.inflections(:en) do |inflect|
  inflect.plural /^(ox)$/i, '\1\2en'
  inflect.singular /^(ox)en/i, '\1'

  inflect.irregular 'octopus', 'octopi'

  inflect.uncountable 'equipment'
end

New rules are added at the top. So in the example above, the irregular rule for octo