Skip to content

Instantly share code, notes, and snippets.

@Gonzih
Created September 3, 2011 07:32
Show Gist options
  • Select an option

  • Save Gonzih/1190795 to your computer and use it in GitHub Desktop.

Select an option

Save Gonzih/1190795 to your computer and use it in GitHub Desktop.
Rails include_root_in_json initializer
ActiveRecord::Base.include_root_in_json = false
# {"post": {"title": "some title", "content": "some content"}}
# will be
# {"title": "some title", "content": "some content}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment