codebrew/backbone-rails — pull request #140 by gabetax (2013-01-05 05:27:50+00:00)
Title: Wrap Backbone.sync instead of redefining it

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