override default pluralize for model-name in rails3

前端 未结 3 2206
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 04:54

my locale is :de and I like to get this:

Sheet.model_name.human.pluralize # => Belegs

to add me a trailing \"e\" instead of \"s\"

<
3条回答
  •  伪装坚强ぢ
    2020-12-05 05:15

    You can override pluralizations this way:

    In config/initializers/inflections.rb

    do:

    ActiveSupport::Inflector.inflections do |inflect|
      inflect.irregular 'Beleg', 'Belege'
    end
    

提交回复
热议问题