I need to allow for customization of json output per account. One person may like the standard json response. Another may wish to have the exact same feed except they need the "name" field called "account_name" or something.
So with a standard user they may be happy with
@model.to_json(only: [:name, :title, :phone])
Another user may wish to see their json response as
@model.to_json(only: [:name (AS ACCOUNT_NAME) , :title, :phone])
I have found solutions that override the as_json/to_json in the model but those seem to be solutions that effect everyone. How can I change them just on a per access/per account basis?
as_jsonin whatever front-end handles the request.