$(document).ajaxSend(function(event, request, options){
  var form_authenticity_token = $("meta[name=authenticity_token]").attr("content")
  if(options.type == 'POST'){
    
    options.data = (options.data ? options.data + "&" : "") +
    "authenticity_token=" + encodeURIComponent(form_authenticity_token)
  }
})