From f1a740ef3cadd2c6cc5ceceb6fd46e2e6825b12b Mon Sep 17 00:00:00 2001 From: Dmitriy Plekhanov Date: Fri, 19 May 2017 22:42:02 +0300 Subject: 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(-) (limited to 'actionview/app/assets') 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 -- cgit v1.2.3 From 48f2a0c566526c291e6e1dd285dd9422802c6d0b Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Mon, 29 May 2017 19:33:44 -0400 Subject: Grammar fixes [ci skip] --- actionview/app/assets/javascripts/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionview/app/assets') diff --git a/actionview/app/assets/javascripts/README.md b/actionview/app/assets/javascripts/README.md index 0819d5da5f..f321b9f720 100644 --- a/actionview/app/assets/javascripts/README.md +++ b/actionview/app/assets/javascripts/README.md @@ -30,7 +30,7 @@ Run `yarn add rails-ujs` to install the rails-ujs package. Usage ------------ -Require `rails-ujs` into your application.js manifest. +Require `rails-ujs` in your application.js manifest. ```javascript //= require rails-ujs @@ -39,7 +39,8 @@ Require `rails-ujs` into your application.js manifest. Usage with yarn ------------ -When using with Webpacker gem or your preferred JavaScript bundler. Just add the following to your main JS file and compile. +When using with the Webpacker gem or your preferred JavaScript bundler, just +add the following to your main JS file and compile. ```javascript import Rails from 'rails-ujs'; -- cgit v1.2.3