From fde724e2104d9254c48ff73b7e9f8f960dd88326 Mon Sep 17 00:00:00 2001 From: Vladislav Date: Sat, 15 Dec 2012 01:35:52 +0400 Subject: [PATCH 1/2] Added description of default_serializer_options In example it's used to set up root: false for controller --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 2d70c71a..48d9dff7 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,18 @@ To specify a custom serializer for the items within an array: ```ruby render :json => @posts, :each_serializer => FancyPostSerializer ``` +#### 4. Define default_serializer_options in your controller +If you define `default_serializer_options` method in your controller, +all serializers in actions of this controller and it's shildren will use them. +One of options may be `root: false` + +```ruby +def default_serializer_options + { + root: false + } +end +``` ## Getting the old version From ccc9c2c69604f978ce246cd3de0e079a52e984dd Mon Sep 17 00:00:00 2001 From: Vladislav Date: Sun, 6 Jan 2013 13:31:35 +0400 Subject: [PATCH 2/2] Update README.md Spelling and murkup mistakes fixed. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 48d9dff7..3a1e9893 100644 --- a/README.md +++ b/README.md @@ -170,8 +170,9 @@ To specify a custom serializer for the items within an array: render :json => @posts, :each_serializer => FancyPostSerializer ``` #### 4. Define default_serializer_options in your controller + If you define `default_serializer_options` method in your controller, -all serializers in actions of this controller and it's shildren will use them. +all serializers in actions of this controller and it's children will use them. One of options may be `root: false` ```ruby