Merge pull request #642 from AlexParamonov/patch-1

Add note for serialization usage outside of ActionController::Base
This commit is contained in:
Steve Klabnik 2014-09-20 17:46:46 -04:00
commit 40d53aaa16

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