I'm trying to render a pretty simple data structure using RABL, but I can't figure out how to remove the child root nodes properly. Here are my two templates.
First, the collection index template.
collection @groups, :object_root => false
attributes :id, :name
child :files do
extends 'groups/_file'
end
And next, the file partial template.
object @file
attributes :id
Those two templates end up producing the following JSON:
[
{
"id":"4f57bf67f85544e620000001",
"name":"Some Group",
"files":[
{
"file":{
"id":"4f5aa3fef855441009000007"
}
}
]
}
]
I want to find a way to remove the root "file" key inside of the files collection. Something like:
[
{
"id":"4f57bf67f85544e620000001",
"name":"Some Group",
"files":[
{
"id":"4f5aa3fef855441009000007"
}
]
}
]