Sha256: 912faf3d4ef4bf403dc7a62ff23221e496ec88ac25666b7be538b5d9dba08995

Contents?: true

Size: 408 Bytes

Versions: 48

Compression:

Stored size: 408 Bytes

Contents

lazy_require = 'jquery'
define 'config/initializers/jquery', [lazy_require], ($) ->
  # 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

48 entries across 48 versions & 1 rubygems

Version Path
ende-0.5.22 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.21 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.20 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.19 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.18 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.17 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.16 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.15 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.14 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.13 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.12 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.10 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.9 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.8 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.7 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.6 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.4.25 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.5 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.4 lib/assets/javascripts/config/initializers/jquery.js.coffee
ende-0.5.3 lib/assets/javascripts/config/initializers/jquery.js.coffee