Skip to content

Instantly share code, notes, and snippets.

@marcialca
Created October 6, 2012 00:45
Show Gist options
  • Save marcialca/3843274 to your computer and use it in GitHub Desktop.
Save marcialca/3843274 to your computer and use it in GitHub Desktop.
[Ruby] [JS] Nice Rails JSON with Backbone.js
In order to get Rails to play well with Backbone you need to tell Rails not to return the root in the JSON return. This is accomplished by adding the following line to an initializer.
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