I'm having an issue with rabl where it is changing the nested node names:
Example, here is my targets/index.json.rabl
collection @customers => :targets
extends 'customers/profile'
And here is my customers/profile.json.rabl
object @customer => :profile
attributes :id, :username, :customer_id, :first_name, :last_name, :avatar_url
The output when hitting targets.json (targets#index):
{
"targets": [
{
"target": {
"id": 3,
"username": null,
"first_name": "Scott",
"last_name": "Thomas",
"avatar_url": null
}
},
{
"target": {
"id": 3,
"username": null,
"first_name": "Thomas",
"last_name": "MacKay",
"avatar_url": null
}
}
]
}
The problem is that I hope the "target" nodes within the "targets" array to be named "profile". Like this:
{
"targets": [
{
"profile": {
"id": 3,
"username": null,
"first_name": "Scott",
"last_name": "Thomas",
"avatar_url": null
}
},
{
"profile": {
"id": 3,
"username": null,
"first_name": "Thomas",
"last_name": "MacKay",
"avatar_url": null
}
}
]
}
Note the "profile" nodes instead of the "target" nodes.
How do I achieve this?