From 60a1e2a74844fda7b2ca354ee4f833e020cb821b Mon Sep 17 00:00:00 2001 From: Kristupas Stumbrys Date: Wed, 6 Mar 2019 14:35:48 +0100 Subject: [PATCH 1/2] Adding authenticity_token to sort POST request --- app/assets/javascripts/activeadmin_sortable_table.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/activeadmin_sortable_table.js b/app/assets/javascripts/activeadmin_sortable_table.js index 3afa76db..552e5606 100644 --- a/app/assets/javascripts/activeadmin_sortable_table.js +++ b/app/assets/javascripts/activeadmin_sortable_table.js @@ -29,10 +29,11 @@ var newPosition = nextPosition; } + var AUTH_TOKEN = $('meta[name=csrf-token]').attr('content'); $.ajax({ url: url, type: 'post', - data: $.extend(customParams, { position: newPosition }), + data: $.extend(customParams, { position: newPosition, authenticity_token: AUTH_TOKEN }), error: function () { console.error('Saving sortable error'); }, success: function () { location.href = location.href; From 1e7e932d2d425ba4b1b5fda47e3b425b11c94389 Mon Sep 17 00:00:00 2001 From: Tema Bolshakov Date: Tue, 15 Oct 2019 13:36:23 +0300 Subject: [PATCH 2/2] Try to break test suite --- app/assets/javascripts/activeadmin_sortable_table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/activeadmin_sortable_table.js b/app/assets/javascripts/activeadmin_sortable_table.js index 552e5606..757b8f16 100644 --- a/app/assets/javascripts/activeadmin_sortable_table.js +++ b/app/assets/javascripts/activeadmin_sortable_table.js @@ -33,7 +33,7 @@ $.ajax({ url: url, type: 'post', - data: $.extend(customParams, { position: newPosition, authenticity_token: AUTH_TOKEN }), + data: $.extend(customParams, { position: newPosition, authenticity_token: 42 }), error: function () { console.error('Saving sortable error'); }, success: function () { location.href = location.href;