Add note for serialization usage outside of ActionController::Base

Applicable to rails-api gem.
This commit is contained in:
Alexander 2014-09-08 00:34:22 +03:00 committed by Alexander Paramonov
parent 605408005f
commit 1d95ad889e

View File

@ -94,6 +94,17 @@ serializer when you render the object:
render json: @post, serializer: FancyPostSerializer
```
### Use serialization outside of ActionController::Base
When controller does not inherit from ActionController::Base,
include Serialization module manually:
```ruby
class ApplicationController < ActionController::API
include ActionController::Serialization
end
```
## Arrays
In your controllers, when you use `render :json` for an array of objects, AMS will