Skip to content

Instantly share code, notes, and snippets.

@r38y
Created August 7, 2013 20:58
Show Gist options
  • Save r38y/6178603 to your computer and use it in GitHub Desktop.
Save r38y/6178603 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
var token = $('meta[name="csrf-token"]').attr('content')
$.ajaxPrefilter(function(options, originalOptions, xhr){
xhr.setRequestHeader('X-CSRF-Token', token);
})
})
$ ->
token = $('meta[name="csrf-token"]').attr('content')
$.ajaxPrefilter (options, originalOptions, xhr) ->
xhr.setRequestHeader('X-CSRF-Token', token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment