From db92de7a2799b34eedf80ef3b2cc687207229220 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 23 Jul 2025 17:43:15 -0500 Subject: [PATCH] `data-controller = form` needs to be on the form or it causes errors - The whole reason we're using `form.submit` here is to prevent clicks on the card link --- app/helpers/notifications_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 8639a95ee..d0451025f 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -42,7 +42,8 @@ module NotificationsHelper method: :delete, class: "card__notification-unread-indicator btn btn--circle borderless", title: "Mark as unseen", - data: { action: "form#submit:stop", controller: "form", form_target: "submit", turbo_frame: "_top" } do + data: { action: "form#submit:stop", form_target: "submit" }, + form: { data: { controller: "form" } } do concat(icon_tag("unseen")) concat(tag.span("Mark as unseen", class: "for-screen-reader")) end @@ -50,7 +51,8 @@ module NotificationsHelper button_to read_notification_path(notification), class: "card__notification-unread-indicator btn btn--circle borderless", title: "Mark as read", - data: { action: "form#submit:stop", controller: "form", form_target: "submit", turbo_frame: "_top" } do + data: { action: "form#submit:stop", form_target: "submit" }, + form: { data: { controller: "form" } } do concat(icon_tag("remove-med")) concat(tag.span("Mark as read", class: "for-screen-reader")) end