From e5e7d337034ffcd01b620e54995daeaacff6c6ce Mon Sep 17 00:00:00 2001 From: Splines Date: Tue, 12 Sep 2023 21:43:40 +0200 Subject: [PATCH] Check if route works via first JS code --- app/javascript/packs/application.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 5c9da133f..d02b6922d 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -52,4 +52,22 @@ document.addEventListener("turbolinks:load", function () { $('.masonry-grid').masonry({ percentPosition: true }); -}) \ No newline at end of file + + checkForNewsPopups(); +}) + +function checkForNewsPopups() { + $.ajax({ + url: Routes.news_popups_path(), + type: 'GET', + dataType: 'json', + success: (data) => { + console.log(data); + }, + error: (xhr, status) => { + console.log('ERROR fetching news popups'); + console.log(xhr); + console.log(status); + } + }) +} \ No newline at end of file