1

money-rails gem 将抛出以下警告

 [DEPRECATION] You are using the default localization behaviour that will change in the next major release. Find out more - https://github.com/RubyMoney/money#deprecation

文档说要设置:

 Money.locale_backend = :i18n

并且,添加:

en:
  number:
    currency:
      format:
      delimiter: ","
      separator: "."

# falling back to
number:
  format:
    delimiter: ","
    separator: "."

更新 en.yml 文件是不言自明的。但是,文档并不清楚在哪里设置 Money.locale_backend = :i18n。

这应该在新的初始化程序中吗?

4

1 回答 1

1

你可以把它设置在config/initializers/money.rb

于 2018-12-01T07:02:14.350 回答