Word of warning
When using the active_model_serializers gem make sure you override the options in the app controller as this gem will override all JSON rendering not just the ActiveModel you're looking to serialise. So use something like:
ruby
defdefault_serializer_options
{ root:false }
end
Without the above you will have a root node in all of your JSON rendering possibly breaking various client side javascript apps and WebService clients that consume the JSON.
Thanks Ryan for another great episode :)
Word of warning
When using the
active_model_serializers
gem make sure you override the options in the app controller as this gem will override all JSON rendering not just the ActiveModel you're looking to serialise. So use something like:Without the above you will have a root node in all of your JSON rendering possibly breaking various client side javascript apps and WebService clients that consume the JSON.