From e2b1257a13f6dd82c32d374d5f50016e45400efd Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Tue, 16 Jan 2024 11:26:08 +0100 Subject: [PATCH] Use `spree` routing proxy in theme selection partial 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 fixes by prefixing the route helper with Solidus' routing proxy. --- .../app/views/spree/admin/shared/_theme_selection.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/views/spree/admin/shared/_theme_selection.html.erb b/backend/app/views/spree/admin/shared/_theme_selection.html.erb index ad4d7a2027e..ad138748bce 100644 --- a/backend/app/views/spree/admin/shared/_theme_selection.html.erb +++ b/backend/app/views/spree/admin/shared/_theme_selection.html.erb @@ -1,6 +1,6 @@ <% 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 %>