From 1d95ad889e83e424264234388c8b4d96b52905a8 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 8 Sep 2014 00:34:22 +0300 Subject: [PATCH] Add note for serialization usage outside of ActionController::Base Applicable to rails-api gem. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index fbcf9152..08021295 100644 --- a/README.md +++ b/README.md @@ -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