Skip to content

Instantly share code, notes, and snippets.

@tdreyno
Created February 15, 2009 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdreyno/64542 to your computer and use it in GitHub Desktop.
Save tdreyno/64542 to your computer and use it in GitHub Desktop.
$(document).ajaxSend(function(event, request, settings) {
if (typeof(AUTH_TOKEN) == "undefined") return;
// settings.data is a serialized string like "foo=bar&baz=boink" (or null)
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