I have a v1/queues/index.rabl
like:
collection @queues
extends "v1/queues/show"
But I want to have a template for successful response which can embed with queue info, like
{
"ok":true,
"data":[@queues' info] (it can be other info too, like @stack info)
}
I am thinking about:
def index
@queues = Queue.all
render 'shared/success',locals: { url: 'v1/queues/index', data: @queues }
end
then create a share/success.rabl
like:
node(:ok) { true }
child(:data) do
extend("v1/queues/index",:object =>data)
end
So in every action, I just need pass the path of the rabl file v1/queues/index
and instance variable to the shared template shared/success
. Is this possible??