Skip to content

Instantly share code, notes, and snippets.

@jimmybaker
Created May 4, 2009 01:35
Show Gist options
  • Save jimmybaker/106259 to your computer and use it in GitHub Desktop.
Save jimmybaker/106259 to your computer and use it in GitHub Desktop.
$(document).ajaxSend(function(event, request, settings) {
if (typeof(AUTH_TOKEN) == "undefined") return;
settings.data = settings.data || "";
settings.data += (settings.data ? "&" : "") + "authenticity_token=" + encodeURIComponent(AUTH_TOKEN);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment