foraker/backbone-rails — pull request #2 by jakesutton (2013-05-24 14:59:37+00:00)
Title: Wrap Backbone.sync instead of redefining it

From codebrew repo pull request
----------
Fixes #139

Backbone.sync in backbone_rails_sync.js has been effectively an independent fork, which has caused an issue with passed in `error` handlers in backbone 0.9.9. Instead of continuing to maintain a separate fork of Backbone.sync, this wraps the original vendor Backbone.sync, to implement the following changes:

- Sets the X-CSRF-Token HTTP header, still backwards compatible with the
- Serializes data inside of `paramRoot`, if specified for the model