From 4be50a4a455a027e228dbd8acf09e0fb786929ec Mon Sep 17 00:00:00 2001 From: Josh Goodall Date: Tue, 16 May 2017 20:21:18 +1000 Subject: Fix server-generated JS response processing on IE9 when using rails-ujs and remote: true --- actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/app') diff --git a/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee b/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee index 26df7b9a3f..a653d3af3d 100644 --- a/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee @@ -14,7 +14,7 @@ AcceptHeaders = Rails.ajax = (options) -> options = prepareOptions(options) xhr = createXHR options, -> - response = processResponse(xhr.response, xhr.getResponseHeader('Content-Type')) + response = processResponse(xhr.response ? xhr.responseText, xhr.getResponseHeader('Content-Type')) if xhr.status // 100 == 2 options.success?(response, xhr.statusText, xhr) else -- cgit v1.2.3 From b0a258fa217551504a4e3399faf4a5fb868f2ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=A0im=C3=A1nek?= Date: Mon, 22 May 2017 09:57:00 +0200 Subject: Update test link in ActionView javascripts README.md. [ci skip] --- actionview/app/assets/javascripts/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/app') diff --git a/actionview/app/assets/javascripts/README.md b/actionview/app/assets/javascripts/README.md index 92f3e8a3b3..399ebc7324 100644 --- a/actionview/app/assets/javascripts/README.md +++ b/actionview/app/assets/javascripts/README.md @@ -39,7 +39,7 @@ Require `rails-ujs` into your application.js manifest. How to run tests ------------ -Run `bundle exec rake ujs:server` first, and then run the web tests by visiting [[http://localhost:4567]] in your browser. +Run `bundle exec rake ujs:server` first, and then run the web tests by visiting http://localhost:4567 in your browser. ## License rails-ujs is released under the [MIT License](MIT-LICENSE). -- cgit v1.2.3 From b8d0a08832a8c03e953f797d94e0766d61b3837e Mon Sep 17 00:00:00 2001 From: Adrian Stainforth Date: Fri, 19 May 2017 21:42:38 +0100 Subject: Update to rails-ujs documentation for yarn install --- actionview/app/assets/javascripts/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionview/app') diff --git a/actionview/app/assets/javascripts/README.md b/actionview/app/assets/javascripts/README.md index 399ebc7324..0819d5da5f 100644 --- a/actionview/app/assets/javascripts/README.md +++ b/actionview/app/assets/javascripts/README.md @@ -36,6 +36,16 @@ Require `rails-ujs` into your application.js manifest. //= require rails-ujs ``` +Usage with yarn +------------ + +When using with Webpacker gem or your preferred JavaScript bundler. Just add the following to your main JS file and compile. + +```javascript +import Rails from 'rails-ujs'; +Rails.start() +``` + How to run tests ------------ -- cgit v1.2.3