Sha256: 6da7a6d9002be2138a454ba3a7e0075565dafb523e31751c8819275136a66c6a

Contents?: true

Size: 354 Bytes

Versions: 54

Compression:

Stored size: 354 Bytes

Contents

Para.ajax = (options = {}) ->
  csrfParam = $('meta[name="csrf-param"]').attr('content')
  csrfToken = $('meta[name="csrf-token"]').attr('content')

  csrfOptions = {}
  csrfOptions[csrfParam] = csrfToken if csrfParam and csrfToken

  unless options.method and options.method.match(/get/i)
    options = $.extend(csrfOptions, options)

  $.ajax(options)

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
para-0.7.3 app/assets/javascripts/para/lib/ajax.coffee
para-0.7.2 app/assets/javascripts/para/lib/ajax.coffee
para-0.7.1 app/assets/javascripts/para/lib/ajax.coffee
para-0.7.0 app/assets/javascripts/para/lib/ajax.coffee
para-0.6.9 app/assets/javascripts/para/lib/ajax.coffee
para-0.6.8 app/assets/javascripts/para/lib/ajax.coffee
para-0.6.7 app/assets/javascripts/para/lib/ajax.coffee
para-0.6.3 app/assets/javascripts/para/lib/ajax.coffee
para-0.6.2 app/assets/javascripts/para/lib/ajax.coffee
para-0.5.4 app/assets/javascripts/para/lib/ajax.coffee
para-0.5.3 app/assets/javascripts/para/lib/ajax.coffee
para-0.5.1 app/assets/javascripts/para/lib/ajax.coffee
para-0.5.0 app/assets/javascripts/para/lib/ajax.coffee
para-0.4.0 app/assets/javascripts/para/lib/ajax.coffee