instance method
plural
Ruby on Rails 8.1.2
Since v2.2.3Signature
plural(rule, replacement)
Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression. The replacement should always be a string that may include references to the matched data from the rule.
Parameters
-
rulereq -
replacementreq
Source
# File activesupport/lib/active_support/inflector/inflections.rb, line 168
def plural(rule, replacement)
@uncountables.delete(rule) if rule.is_a?(String)
@uncountables.delete(replacement)
@plurals.prepend([rule, replacement])
end
Defined in activesupport/lib/active_support/inflector/inflections.rb line 168
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Inflector::Inflections