Rails 4: pluralizing model_name.human using count: 123 does not work

From Rail 3, I'm used to doing this:

User.model_name.human count: 2 # "Users"

Does this not work in Rails 4?

[1] base »  User.model_name.human count: 2
=> "User"

While a plural simple line works:

[2] base »  "User".pluralize
=> "Users"

Any idea what the problem is here?

+4
source share
1 answer

This requires that you change your * .yml language as such:

activerecord:
  ...

  models:
    sheet:
      one: User
      other: Users

Regarding this

+6
source

Source: https://habr.com/ru/post/1534024/


All Articles