Method: ActiveSupport::Inflector#inflections
- Defined in:
- activesupport/lib/active_support/inflector/inflections.rb
permalink #inflections(locale = :en) ⇒ Object
Yields a singleton instance of Inflector::Inflections so you can specify additional inflector rules. If passed an optional locale, rules for other languages can be specified. If not specified, defaults to :en
. Only rules for English are provided.
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.uncountable 'rails'
end
263 264 265 266 267 268 269 |
# File 'activesupport/lib/active_support/inflector/inflections.rb', line 263 def inflections(locale = :en) if block_given? yield Inflections.instance(locale) else Inflections.instance_or_fallback(locale) end end |