Skip to content

Instantly share code, notes, and snippets.

@ericcf
Created June 22, 2011 15:15
Show Gist options
  • Save ericcf/1040308 to your computer and use it in GitHub Desktop.
Save ericcf/1040308 to your computer and use it in GitHub Desktop.
don't include root in json
# instead of { "my_model": { "id": 1, "title": "foo" } }
# to_json produces { "id": 1, "title": "foo" }
ActiveRecord::Base.include_root_in_json = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment