Skip to content

Instantly share code, notes, and snippets.

@jboulhous
Forked from mxriverlynn/setupCSRF.js
Created October 11, 2012 12:32
Show Gist options
  • Save jboulhous/3872012 to your computer and use it in GitHub Desktop.
Save jboulhous/3872012 to your computer and use it in GitHub Desktop.
$.ajaxSetup({
beforeSend: function(xhr) {
xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment