Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Upgrades Backbone's sync() to enable Rails3 + Backbone.js authenticity token passing
branch: master
Failed to load latest commit information.
LICENSE Add MIT license
README some documentation
backbonerailsauthtokenadapter.js initial code


If you are using Backbone.js with Rails 3 and are noticing that your authenticity token is not being passed in with Backbone's XHR calls, include this code and run it like so:


The default method of operation assumes Rails' csrf_meta_tag call has already happened and that jQuery and Backbone are present. Thus it's best to run this code after Backbone, jQuery, and the metatag have been loaded but *before* your Backbone app makes its first request.

This code was adapted from:

Thanks to Nick Gauthier ( @ngauthier )

Something went wrong with that request. Please try again.