Sha256: 82d2fb7b00768d2823238ec933de96cd3c40e2020ac6e24da5abf85c4d32bfbf

Contents?: true

Size: 876 Bytes

Versions: 31

Compression:

Stored size: 876 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
        safe_join(options)
      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
        safe_join(options)
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
spree_backend-3.1.14 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.13 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.12 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.2.3 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.1.4 app/helpers/spree/admin/products_helper.rb
solidus_backend-1.0.7 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.11 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.10 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.9 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.8 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.7 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.6 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.5 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.4 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.3 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.2 app/helpers/spree/admin/products_helper.rb
spree_backend-3.0.10 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.1 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.0 app/helpers/spree/admin/products_helper.rb
spree_backend-3.1.0.rc4 app/helpers/spree/admin/products_helper.rb