From c2ad8f359dbbb336d4aa7175333237c788359d13 Mon Sep 17 00:00:00 2001 From: Kevin Reintjes Date: Mon, 27 Jan 2020 15:18:50 +0100 Subject: [PATCH] Fix CSV export link in combination with Turbolinks 5 Fixes https://github.com/leikind/wice_grid/issues/326 --- CHANGELOG.md | 1 + vendor/assets/javascripts/wice_grid_processor.js.coffee | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e914e3cb..09ef2d79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Unreleased * Fix bug in "Dangerous query methods" deprecation warning fix in custom order when using Arel.sql +* Fix CSV export download link in combination with Turbolinks 5 (download the file instead of rendering it as text) ## 4.1.0 (28 November, 2018) diff --git a/vendor/assets/javascripts/wice_grid_processor.js.coffee b/vendor/assets/javascripts/wice_grid_processor.js.coffee index cef7f0f4..07d7cdd6 100644 --- a/vendor/assets/javascripts/wice_grid_processor.js.coffee +++ b/vendor/assets/javascripts/wice_grid_processor.js.coffee @@ -84,7 +84,7 @@ class WiceGridProcessor exportToCsv : -> - @visit @linkForExport + window.location = @linkForExport register : (func)->