Module: Spree::Admin::ProductsHelper
- Defined in:
- app/helpers/spree/admin/products_helper.rb
Instance Method Summary collapse
Instance Method Details
#option_types_options_for(product) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'app/helpers/spree/admin/products_helper.rb', line 15 def (product) = @option_types.map do |option_type| selected = product.option_types.include?(option_type) content_tag(:option, :value => option_type.id, :selected => ('selected' if selected)) do option_type.name end end.join("").html_safe end |
#taxon_options_for(product) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'app/helpers/spree/admin/products_helper.rb', line 4 def (product) = @taxons.map do |taxon| selected = product.taxons.include?(taxon) content_tag(:option, :value => taxon.id, :selected => ('selected' if selected)) do (taxon.ancestors.pluck(:name) + [taxon.name]).join(" -> ") end end.join("").html_safe end |