New to rabl and not sure how to do this with two different arrays returned in a single hash like this:
@data={:locations => [location1, location2], :items => [item1,item2]}
In my rabl file, I'd like to do something like the following:
@data[:locations]
extends "api/location_show"
@data[:items]
extends "api/item_show"
to output this:
{
"locations": [
{
"id": 156,
"name": "Location 1"
},
{
"id": 158,
"name": "Location 2"
}
],
"items": [
{
"global_id": 3189,
"header": "pistachio 1"
},
{
"global_id": 3189,
"header": "pistachio 2"
}
]
}
but it just doesn't seem to be working. Is there a way to get this to work?
thx