Created
October 6, 2012 00:45
-
-
Save marcialca/3843274 to your computer and use it in GitHub Desktop.
[Ruby] [JS] Nice Rails JSON with Backbone.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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