Sha256: 0185f2aafb6fc91eaa7b2437545c84a3c0a962bb2e0cca0bab5d01897c57d718

Contents?: true

Size: 724 Bytes

Versions: 28

Compression:

Stored size: 724 Bytes

Contents

module Spree
  module Admin
    module TaxonsHelper
      def taxon_path(taxon)
        taxon.ancestors.reverse.collect { |ancestor| ancestor.name }.join( " >> ")
      end
  
      def taxons_checkbox_tree(root, product)
        return '' if root.children.blank?
        content_tag 'ul' do
          root.children.map do |taxon|
            content_tag 'li' do
              [check_box_tag("taxon_ids[]", taxon.id, product.taxons.include?(taxon), :id => "taxon_ids_#{taxon.id}"),
               label_tag("taxon_ids_#{taxon.id}", taxon.name)].join(' ').html_safe +
              taxons_checkbox_tree(taxon, product)
            end.html_safe
          end.join("\n").html_safe
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
spree_core-1.2.5 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.6 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.5 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.2.4 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.0.7 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.2.3 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.2.2 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.4 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.2.0 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.2.0.rc2 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.2.0.rc1 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.3 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.0.6 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.2 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.2.rc1 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.1 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.0 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.0.4 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.0.rc2 app/helpers/spree/admin/taxons_helper.rb
spree_core-1.1.0.rc1 app/helpers/spree/admin/taxons_helper.rb