Created
November 9, 2015 07:46
-
-
Save marvinahv/94dc0cbda6f80374810b to your computer and use it in GitHub Desktop.
Javascript file for ajax sign in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).load(function(){ | |
(function(jQuery) { | |
$.ajaxSetup({ | |
beforeSend: function(xhr) { | |
var token = jQuery('meta[name="_csrf"]').attr('content'); | |
xhr.setRequestHeader('X-CSRF-Token', token); | |
} | |
}); | |
}(jQuery)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment