在我看来,我有:
<%= f.date_select :start %>
我得到了错误消息:can't convert Symbol into String
我知道它与it.date.order规则有关,但我看到rails-i18n包含了它:https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/it.yml#L51
这是怎么回事?
全程跟踪:https://gist.github.com/4007557
编辑:在控制台中运行I18n.t 'date.order'会得到=> [:day, :month, :year]。这是正确的..。那么为什么date_select不能工作呢?
关于GitHub回购的问题:https://github.com/svenfuchs/rails-i18n/issues/273
发布于 2012-11-04 23:51:21
我以前遇到过类似的问题,如果不是同样的问题。当时,我使用以下命令修复了它:
date:
order: [ !ruby/symbol day, !ruby/symbol month, !ruby/symbol year ]发布于 2012-11-04 23:11:47
据我所知,关于date_select的rails docs希望有一个字符串。
如果:start是您的I18n的名称,那么根据我的记忆,您应该使用<%= f.date_select t(:start) %>。
发布于 2013-03-19 18:06:04
你不需要触摸你的表单:这是一个翻译问题。您应该在it.yml文件中添加您可以在此处找到的行:https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale。
https://stackoverflow.com/questions/13219204
复制相似问题