I'm using liberator for REST service and my content type is json.
When :authorized?(or other decisions) fails it returns text/html which i don't want.
I need liberator to return json data format for all type of errors.
I'm using liberator for REST service and my content type is json.
When :authorized?(or other decisions) fails it returns text/html which i don't want.
I need liberator to return json data format for all type of errors.
Copyright © 2021 Jogjafile Inc.
Handlers can be used to customise what to do in different cases like handle ok, resource is not found or user is not authenticated. For example:
As in other cases, handler can be a constant value or a function that will produce it.