From ea0cedec72e869f4cb9d5ea11d2e9266e26b9bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= <15726+Senen@users.noreply.github.com> Date: Mon, 11 Dec 2023 13:11:59 +0100 Subject: [PATCH] [EXP] Make AJAX settings work when javascript is disabled Otherwise we get a AuthenticityToken exception. I was nor able to write a test to verify this change. --- .../admin/settings/featured_settings_form_component.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/admin/settings/featured_settings_form_component.html.erb b/app/components/admin/settings/featured_settings_form_component.html.erb index fb73a042b..be2fa16a8 100644 --- a/app/components/admin/settings/featured_settings_form_component.html.erb +++ b/app/components/admin/settings/featured_settings_form_component.html.erb @@ -1,4 +1,4 @@ -<%= form_for([:admin, feature], remote: remote?, html: { class: "featured-settings-form" }) do |f| %> +<%= form_for([:admin, feature], remote: remote?, authenticity_token: true, html: { class: "featured-settings-form" }) do |f| %> <%= hidden_field_tag :tab, tab if tab %> <%= f.hidden_field :describedby, id: dom_id(feature, :describedby), value: describedby if describedby %> <%= f.hidden_field :value, id: dom_id(feature, :value), value: (enabled? ? "" : "active") %>