I'm trying to format the serialized output from the active_model_serializers gem as key/value pairs.
By default, ActiveModel::Serializer
renders an output like this:
[
{
"id": 1,
"value": "foo"
},
{
"id": 2,
"value": "bar"
}
]
I'm looking to format the output like this:
{
1: {
"value": "foo"
},
2: {
"value": "bar"
}
}
Is this possible using active_model_serializers?