mirror of
https://github.com/samsonjs/grape-active_model_serializers.git
synced 2026-03-25 08:45:55 +00:00
add documentation
This commit is contained in:
parent
b2654190c1
commit
8b8da16ffe
1 changed files with 6 additions and 0 deletions
|
|
@ -36,6 +36,12 @@ require 'grape-active_model_serializers'
|
|||
class API < Grape::API
|
||||
format :json
|
||||
formatter :json, Grape::Formatter::ActiveModelSerializers
|
||||
|
||||
# Serializes errors with ActiveModel::Serializer::ErrorSerializer if an ActiveModel.
|
||||
# Serializer conforms to the adapter, ex: json, jsonapi.
|
||||
# So an error formatted with a jsonapi formatter would render as per:
|
||||
# http://jsonapi.org/format/#error-objects
|
||||
error_formatter :json, Grape::Formatter::ActiveModelSerializers
|
||||
end
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue