1

I need very accurate pluralization for my application

I am currently using the Rails built in pluralization method.

I found a problem with the word 'foot'.

When I do:

"foot".pluralize(2)
=> "foots"

The correct pluralization should be feet.

How can I get more accurate results? I have looked for other gems and they all seem to make the same error.

chell
  • 7,646
  • 16
  • 74
  • 140

1 Answers1

3

you need to define below code inside your config/initializers/inflections.rb

ActiveSupport::Inflector.inflections(:en) do |inflect|
  inflect.irregular 'foot', 'feet'
end
  • there are some of plural are not define yet, so you need to define it inside inflections.