mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Clean up docs
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
The AMS grape formatter relies on the existence of `env['grape.request']` which is implemeted by `Grape::Middleware::Globals`. You can meet his dependency by calling it before mounting the endpoints.
|
||||
[Back to Guides](../README.md)
|
||||
|
||||
The ActiveModelSerializers grape formatter relies on the existence of `env['grape.request']` which is implemeted by `Grape::Middleware::Globals`. You can meet his dependency by calling it before mounting the endpoints.
|
||||
|
||||
In the simpliest way:
|
||||
|
||||
@@ -15,10 +17,10 @@ or more like what is shown in current Grape tutorials:
|
||||
module MyApi
|
||||
class ApiBase < Grape::API
|
||||
use Grape::Middleware::Globals
|
||||
|
||||
|
||||
require 'grape/active_model_serializers'
|
||||
include Grape::ActiveModelSerializers
|
||||
|
||||
|
||||
mount MyApi::V1::ApiBase
|
||||
end
|
||||
end
|
||||
@@ -30,10 +32,10 @@ You could meet this dependency with your own middleware. The invocation might lo
|
||||
module MyApi
|
||||
class ApiBase < Grape::API
|
||||
use My::Middleware::Thingamabob
|
||||
|
||||
|
||||
require 'grape/active_model_serializers'
|
||||
include Grape::ActiveModelSerializers
|
||||
|
||||
|
||||
mount MyApi::V1::ApiBase
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user