From 0e02e79af8c9d3627fd1b3c2c9a9ab077cb27272 Mon Sep 17 00:00:00 2001 From: Gabe Martin-Dempesy Date: Fri, 30 Nov 2012 13:47:09 -0600 Subject: [PATCH] Update documentation to use ActiveSupport.on_load to disable root --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 925a41f2..2d70c71a 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,9 @@ more concise json. To disable the root element for arrays, you have 3 options: #### 1. Disable root globally for in `ArraySerializer`. In an initializer: ```ruby -ActiveModel::ArraySerializer.root = false +ActiveSupport.on_load(:active_model_serializers) do + self.root = false +end ``` #### 2. Disable root per render call in your controller: