-1
저는 Sinatra에서 빌드하고 API로 rabl을 사용하고 있습니다.노드 레이블이없는 자식 노드를 rabl에 렌더링
object @user
attributes :profile_photo => :profile_photo, :name => :first_name, :last_name => :last_name
child :addresses do
attributes :id
child :country do
attributes :name
end
end
나는 다음과 같은 JSON 점점 오전 : 필요한 JSON이 Rabl 템플릿을 사용하여 일부 노드 에 라벨을 허용하지 데
{
user: {
profile_photo: null,
first_name: "John",
last_name: "Doe",
addresses: [
{
address: {
id: 43,
country: {
name: "Iceland"
}
}
},
{
address: {
id: 44,
country: {
name: "Cambodia"
}
}
},
{
address: {
id: 45,
country: {
name: "North Korea"
}
}
}
]
}
}
내가 싶어 원하는 것은 :
{
user: {
profile_photo: null,
first_name: "John",
last_name: "Doe",
addresses: [
{
{
id: 43,
country: {
name: "Iceland"
}
}
},
{
{
id: 44,
country: {
name: "Cambodia"
}
}
},
{
{
id: 45,
country: {
name: "North Korea"
}
}
}
]
}
}
Rabl에서 할 수있는 방법이 있습니까?