Skip to content

Commit

Permalink
Theme selection for Solidus Admin: Use spree routing proxy
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
mamhoff committed Jan 18, 2024
1 parent 69090d5 commit f4c96a8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% theme_options_for_select = Spree::Backend::Config.themes.keys.map { |theme| [theme.to_s.humanize, theme] }.sort %>

<li>
<%= 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 %>
<label>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-sun-line"></use></svg>
Expand All @@ -12,7 +12,7 @@
</label>
<% 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 %>
<label>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-moon-line"></use></svg>
Expand Down

0 comments on commit f4c96a8

Please sign in to comment.