Skip to content

Instantly share code, notes, and snippets.

@SlyDen
Created June 16, 2014 06:59
Show Gist options
  • Save SlyDen/cb019ef189562c9d809b to your computer and use it in GitHub Desktop.
Save SlyDen/cb019ef189562c9d809b to your computer and use it in GitHub Desktop.
$ ->
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