how can I create a json with this key & value mapping?
i.e.
[{ "21": "Jason" },
{ "22": "Britney" },
{ "25": "Donald" },
{ "#{id}": "#{name}" }]
Is it possible to achieve this using the Active Model Serializers gem?
Why do you need a serializer?
users.map{|u| { "#{id}": name }.to_json