Sha256: 26ba156f0034d2c31b6157d881e5a7d258779510f83f49a1fed0aa44df32829e
Contents?: true
Size: 712 Bytes
Versions: 7
Compression:
Stored size: 712 Bytes
Contents
// Ensures AJAX requests are properly formated so that Rails knows how to respond to them. $.ajaxSetup({ beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} }); /* Ensures AJAX requests have the proper Rails authenticity token. See the following for more info: http://henrik.nyh.se/2008/05/rails-authenticity-token-with-jquery http://dev.jquery.com/ticket/3387 */ $(document).ajaxSend(function(event, request, settings){ var authToken = "<%= form_authenticity_token %>"; if (authToken != null){ settings.data = settings.data || ""; settings.data += (settings.data ? "&" : "") + "authenticity_token=" + encodeURIComponent(authToken); }; });
Version data entries
7 entries across 7 versions & 2 rubygems