Ruby on Rails: How do you explicitly define plural names and singular names in Rails?

后端 未结 3 1785
故里飘歌
故里飘歌 2020-12-04 21:00

For example, I\'m using \"Bonus\" as my model, so I\'d expect \"bonuses\" to be the plural form and \"bonus\" to be the singular form.

However, in Ruby, this results

3条回答
  •  -上瘾入骨i
    2020-12-04 21:50

    Just to back up bcarlso, more on Inflector can be found here:

    http://4loc.wordpress.com/2009/04/09/inflector-rails-pluralization/

    Note that the position of the Inflector.inflections block is important and, as noted in the link reference, must be after the Initializer.run block.

提交回复
热议问题