我在寻找如何创建使用JBuilder的嵌套JSON输出的例子。
我想创建和类似的输出:
{
"name": "John Doe",
"reservations": [
{
"restaurant": "ABC",
"reservation_time": "2012/12/01 20:00",
"details": {
"address": "somewhere",
"rating": "5"
}
},
{
"restaurant": "CDE",
"reservation_time": "2012/12/04 20:00",
"details": {
"address": "somewhere else",
"rating": "3"
}
}
]
}