pluralize

pluralize(count, singular, plural = nil)
Instance Public methods

Attempts to pluralize the singular word unless count is 1. If plural is supplied, it will use that when count is > 1, otherwise it will use the Inflector to determine the plural form.

1
2
3
4
5
6
7
8
9
10
11
pluralize(1, 'person')
# => 1 person
 
pluralize(2, 'person')
# => 2 people
 
pluralize(3, 'person', 'users')
# => 3 users
 
pluralize(0, 'person')
# => 0 people
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.