Active Model Serializer and Custom JSON Structure

Viewed 2649

I'm trying to use the Active Model Serializer gem with my API, although I am struggling with something I thought would be pretty simple.

All my JSON responses are in a wrapped format, with every response having a top level message and status property, the data is within the content property. Every JSON response follows this format.

Example

{
  'status': statuscode,
  'message': message,
  'content': { 'object':obj }
}

The contents of the "content" property is where I would like to place the output of the Serializer. My lists of articles, etc.

I cannot figure out how to do this though?

Any help would be greatly appreciated.

1 Answers
Related