def plural(value, string)
"#{value} #{value.abs == 1 ? string.singularize : string.pluralize}"
end
If not, what would be a short, sweet name for this method?
ActionView::Helpers::TextHelper
pluralize(1, 'person')
# => 1 person
pluralize(2, 'person')
# => 2 people
More documentation and examples available here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With