Skip to content

Commit

Permalink
Use spree routing proxy in theme selection partial
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 fixes by prefixing the route helper with Solidus'
routing proxy.

(cherry picked from commit e2b1257)
  • Loading branch information
mamhoff committed Jan 18, 2024
1 parent 3cef95b commit baecd38
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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 %>
<label class="admin-navbar-selection">
<i class="fa fa-sun-o fa-fw" title="<%= I18n.t('spree.choose_dashboard_theme') %>"></i>
Expand All @@ -10,7 +10,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 class="admin-navbar-selection">
<i class="fa fa-moon-o fa-fw" title="<%= I18n.t('spree.choose_dashboard_theme') %>"></i>
Expand Down

0 comments on commit baecd38

Please sign in to comment.