mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
use :root option in render :json
ArraySerializer can now render arrays with no root
This commit is contained in:
@@ -41,7 +41,7 @@ module ActionController
|
||||
|
||||
def _render_option_json(json, options)
|
||||
if json.respond_to?(:to_ary)
|
||||
options[:root] ||= controller_name
|
||||
options[:root] ||= controller_name unless options[:root] == false
|
||||
end
|
||||
|
||||
serializer = options.delete(:serializer) ||
|
||||
|
||||
Reference in New Issue
Block a user