Skip to content

Instantly share code, notes, and snippets.

@mataki
Created February 9, 2011 07:08
Show Gist options
  • Save mataki/818083 to your computer and use it in GitHub Desktop.
Save mataki/818083 to your computer and use it in GitHub Desktop.
$(document).ajaxSend(function(e, xhr, options) {
var token = $("meta[name='csrf-token']").attr("content");
xhr.setRequestHeader("X-CSRF-Token", token);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment