diff --git a/app/helpers/spree/admin/navigation_helper.rb b/app/helpers/spree/admin/navigation_helper.rb index 2cdf34e0cb..7ad386af2b 100644 --- a/app/helpers/spree/admin/navigation_helper.rb +++ b/app/helpers/spree/admin/navigation_helper.rb @@ -353,6 +353,10 @@ def images_actions def prices_actions Rails.application.config.spree_backend.actions[:prices] end + + def store_credits + Rails.application.config.spree_backend.actions[:store_credits] + end # rubocop:enable Metrics/ModuleLength end end diff --git a/app/views/spree/admin/store_credits/index.html.erb b/app/views/spree/admin/store_credits/index.html.erb index 9548c8e9e6..b36991c2da 100644 --- a/app/views/spree/admin/store_credits/index.html.erb +++ b/app/views/spree/admin/store_credits/index.html.erb @@ -5,11 +5,11 @@ <% end %> <% content_for :page_actions do %> - <% images_actions.items.each do |action| %> + <% store_credits.items.each do |action| %> <% next unless action.available?(current_ability) %> <%= button_link_to( action.text, - action.url(@product), + action.url(@user), class: action.classes, icon: action.icon_name ) %> diff --git a/lib/spree/backend/engine.rb b/lib/spree/backend/engine.rb index 151ebd9405..4cb1a04386 100644 --- a/lib/spree/backend/engine.rb +++ b/lib/spree/backend/engine.rb @@ -38,6 +38,7 @@ class Engine < ::Rails::Engine Rails.application.config.spree_backend.actions[:user] = Spree::Admin::Actions::UserDefaultActionsBuilder.new.build Rails.application.config.spree_backend.actions[:products] = Spree::Admin::Actions::ProductsDefaultActionsBuilder.new.build Rails.application.config.spree_backend.actions.include?(:images) ? (Rails.application.config.spree_backend.actions[:images].items << Spree::Admin::Actions::ImagesDefaultActionsBuilder.new.build.items).flatten! : Rails.application.config.spree_backend.actions[:images] = Spree::Admin::Actions::ImagesDefaultActionsBuilder.new.build + Rails.application.config.spree_backend.actions[:store_credits] = Spree::Admin::Actions::StoreCreditsDefaultActionsBuilder.new.build end end end