number_to_currency给出"can't convert symbol to integer"错误



我正在使用方法number_to_currency,但不断收到错误。这是我尝试过的:

= number_to_currency(233)

和:

= number_to_currency(233, locale: :en)

他们都提出了他的错误:

can't convert Symbol into Integer

知道为什么会这样吗?

显然,问题出在我的en.yml文件中。number_to_currency方法使用 yml 文件中的"数字"路径进行翻译,而我的是错误的。我从这里采用了正确的 yml 格式。

感谢所有帮手

相关内容