【发布时间】:2018-04-23 09:05:45
【问题描述】:
我目前正在研究统计数据,所以我得到了一个包含我所有数据的数组。问题是这些数据包含枚举,我想在不覆盖其余部分的情况下翻译它们。
这是一个包含我的数组的给定示例(它包含数百个):
#<Infosheet id: 90, date: "2018-04-22 00:00:00", number: 7, way: "home", gender: "man", age: "age1", district: "", intercommunal: "", appointment: true, othertype: "", otherorientation: "", user_id: 3, created_at: "2018-04-22 17:51:16", updated_at: "2018-04-22 17:51:16", typerequest_id: 168, orientation_id: 188, info_number: nil, city_id: 105>
我想翻译“方式”或“性别”或“年龄”的枚举,同时保留其余数据,因为目前,如果我在控制台中进行翻译,它会粉碎其他所有数据。
你知道怎么做吗?
谢谢!
【问题讨论】:
标签: ruby-on-rails json ruby enums translate