Move options code into helper

This commit is contained in:
Maikel Linke
2026-02-12 11:47:01 +11:00
parent 283d13eb35
commit 3be0cca230
2 changed files with 5 additions and 1 deletions

View File

@@ -9,6 +9,10 @@ module Spree
I18n.t(key, scope:)
end
def payment_method_type_options(providers)
providers.map { |p| [payment_method_type_name(p), p] }
end
end
end
end

View File

@@ -3,6 +3,6 @@
.alpha.four.columns
= label :payment_method, :type, t('.provider')
.omega.twelve.columns
= select(:payment_method, :type, @providers.map { |p| [payment_method_type_name(p), p] }, {}, { class: 'select2 fullwidth', 'provider-prefs-for' => "#{@object.id}"})
= select(:payment_method, :type, payment_method_type_options(@providers), {}, { class: 'select2 fullwidth', 'provider-prefs-for' => "#{@object.id}"})
%div{"ng-include" => "include_html" }