Sha256: fb9eb7ba7e849cdfe1ea799125360ee8a82b61eb6786e25d85262c08208ac881

Contents?: true

Size: 860 Bytes

Versions: 106

Compression:

Stored size: 860 Bytes

Contents

module Spree
  module Admin
    module ProductsHelper
      def taxon_options_for(product)
        options = @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

      def option_types_options_for(product)
        options = @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
    end
  end
end

Version data entries

106 entries across 106 versions & 3 rubygems

Version Path
spree_backend-3.0.6.1 app/helpers/spree/admin/products_helper.rb
spree_backend-3.0.6 app/helpers/spree/admin/products_helper.rb
spree_backend-3.0.5 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.2.0 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.2.0.rc2 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.0.4 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.1.2 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.2.0.rc1 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.2.0.beta1 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.0.3 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.1.1 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.1.0 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.1.0.pre2 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.1.0.pre1 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.1.0.beta1 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.0.2 app/helpers/spree/admin/products_helper.rb
spree_backend-3.0.4 app/helpers/spree/admin/products_helper.rb
spree_backend-2.4.10 app/helpers/spree/admin/products_helper.rb
spree_backend-2.3.13 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.0.1 app/helpers/spree/admin/products_helper.rb