From f1a740ef3cadd2c6cc5ceceb6fd46e2e6825b12b Mon Sep 17 00:00:00 2001 From: Dmitriy Plekhanov Date: Fri, 19 May 2017 22:42:02 +0300 Subject: [PATCH] Check for jQuery ajax jQuery slim version doesn't have ajax, so if a person include this version ajaxFilter raises error. --- actionview/app/assets/javascripts/rails-ujs/start.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionview/app/assets/javascripts/rails-ujs/start.coffee b/actionview/app/assets/javascripts/rails-ujs/start.coffee index 5746a22287..55595ac96f 100644 --- a/actionview/app/assets/javascripts/rails-ujs/start.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/start.coffee @@ -9,7 +9,7 @@ } = Rails # For backward compatibility -if jQuery? and not jQuery.rails +if jQuery? and jQuery.ajax? and not jQuery.rails jQuery.rails = Rails jQuery.ajaxPrefilter (options, originalOptions, xhr) -> CSRFProtection(xhr) unless options.crossDomain