【发布时间】:2013-12-02 07:41:34
【问题描述】:
使用JBuilder有如下代码:
json.details place.details
if (place.type == 'restaurant')
json.food_types place.details.food_types, :id
end
JSON 响应:
details":{"average_check":100,"id":12},"food_types":[{"id":1}]}
现在我需要将 food_types 移至细节:
details":{"average_check":100,"id":12", food_types":[{"id":1}]}}
我该怎么做?
【问题讨论】: