Sha256: 1dd496617987875907ac50ac3854a45084b8ff35d780897a401850300245d1c6

Contents?: true

Size: 351 Bytes

Versions: 8

Compression:

Stored size: 351 Bytes

Contents

require ['jquery'], ($) ->
  # TODO use prefilter instead of beforeSend
  # $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
  $.ajaxSetup
    beforeSend: (xhr) ->
      token = $('meta[name="csrf-token"]').attr('content')
      token and xhr.setRequestHeader 'X-CSRF-Token', token

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ende-0.3.13 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.3.12 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.3.11 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.3.10 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.3.9 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.3.8 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.3.7 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.3.6 lib/assets/javascripts/config/initializers/jquery.js.coffee