RailsCasts Pro episodes are now free!

Learn more or hide this

Michael Harrison's Profile

GitHub User: michael-harrison

Comments by Michael Harrison

Avatar

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:

ruby
  def default_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.