Rails uses regex-based pluralization rules and knows some irregular plurals by default (person/people, child/children, zombie/zombies), but many domain-specific words like criterion/criteria are not covered. Using `inflect.irregular` in `config/initializers/inflections.rb` teaches Rails the correct singular/plural pair, making it work bidirectionally for model table names, routes, associations, fixtures, and factories. The post also covers when not to add inflections (if Rails already handles it), and mentions `inflect.uncountable` for words like 'sheep' and `inflect.acronym` for casing issues.

2m read timeFrom andycroll.com
Post cover image
Table of contents
Instead of…Use…Why?Why not?

Sort: