I'm trying to build an api-only app in rails 5. I'm using active model serializer (AMS).
On my GET /users (UsersController#index) endpoint, I want the root json to have a "users" keyword before the json array of users.
If I set an initializer with ActiveModelSerializers.config.adapter = :json
value, then I have the desired behavior.
But then, on the GET /users/1 the simple user json comes under the key user. I'd like to get rid of this key (in this case) and simply answer the user json as the root json.
The question is: how can I define the AMS adapter on a specific endpoint/response/method? Is that possible?