From 24ee60da80531a7009c60364b194f390e30a1428 Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Thu, 18 Jan 2024 16:48:39 +0100 Subject: [PATCH] Theme selection for Solidus Admin: Use spree routing proxy When using the navigation from a gem that isolates its namespace in such a way that the default route helper is not spree, this partial fails to render with an undefined method error. This can easily be fixed by prefixing the route helper with Solidus' routing proxy. This is the same problem and solution as #5599, just for the theme selection partial that is used when using the current admin (rather than the new one). (cherry picked from commit f4c96a8ba8cbd7f2dafd7548aa1f0935cf4697e2) --- .../admin/shared/_theme_selection_solidus_admin.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/views/spree/admin/shared/_theme_selection_solidus_admin.html.erb b/backend/app/views/spree/admin/shared/_theme_selection_solidus_admin.html.erb index d2309396d41..de8531c9277 100644 --- a/backend/app/views/spree/admin/shared/_theme_selection_solidus_admin.html.erb +++ b/backend/app/views/spree/admin/shared/_theme_selection_solidus_admin.html.erb @@ -1,7 +1,7 @@ <% theme_options_for_select = Spree::Backend::Config.themes.keys.map { |theme| [theme.to_s.humanize, theme] }.sort %>
  • - <%= form_tag(admin_set_theme_path(format: :html), method: :put, style: "width: 100%;", class: "light-only") do %> + <%= form_tag(spree.admin_set_theme_path(format: :html), method: :put, style: "width: 100%;", class: "light-only") do %> <%= hidden_field_tag :system_theme, :light %> <% end %> - <%= form_tag(admin_set_theme_path(format: :html), method: :put, style: "width: 100%;", class: "dark-only") do %> + <%= form_tag(spree.admin_set_theme_path(format: :html), method: :put, style: "width: 100%;", class: "dark-only") do %> <%= hidden_field_tag :system_theme, :dark %>