pluralize(integer, string)

pluralize takes an integer argument and then returns the number with a properly pluralized version of its second argument. It isn’t available in the console by default, but we can include it explicitly through the ActionView::Helpers::TextHelper module.

>> ActionView::Helper::TextHelper
>> pluralize(2, “woman”)
=> “2 women”
>> pluralize(3, “erratum”)
=> “3 errata”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s