Skip to content

Instantly share code, notes, and snippets.

@carhartl
Created November 23, 2011 17:00
Show Gist options
  • Save carhartl/1389213 to your computer and use it in GitHub Desktop.
Save carhartl/1389213 to your computer and use it in GitHub Desktop.
Make Zepto XHR play nicely with Rails XSS protection
$.ajaxSettings.headers || ($.ajaxSettings.headers = {});
$.ajaxSettings.headers['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