Sha256: f600b37dd6a2441484d7843f9fbb7b6abd9deb85aae95d6c138b6efa7aeb7802

Contents?: true

Size: 625 Bytes

Versions: 23

Compression:

Stored size: 625 Bytes

Contents

module Admin::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

Version data entries

23 entries across 23 versions & 6 rubygems

Version Path
spree_core-0.70.7 app/helpers/admin/taxons_helper.rb
spree_core-0.70.6 app/helpers/admin/taxons_helper.rb
apispree_core-0.0.0 app/helpers/admin/taxons_helper.rb
My-Commerce_core-1.1.0 app/helpers/admin/taxons_helper.rb
My-Commerce_core-1.0.0 app/helpers/admin/taxons_helper.rb
MyCommerceapi-1.0.0 core/app/helpers/admin/taxons_helper.rb
MyCommerce-0.0.3 core/app/helpers/admin/taxons_helper.rb
rfcommerce_core-0.0.3 app/helpers/admin/taxons_helper.rb
spree_core-0.60.6 app/helpers/admin/taxons_helper.rb
spree_core-0.70.5 app/helpers/admin/taxons_helper.rb
spree_core-0.70.4 app/helpers/admin/taxons_helper.rb
spree_core-0.60.5 app/helpers/admin/taxons_helper.rb
spree_core-0.70.3 app/helpers/admin/taxons_helper.rb
spree_core-0.70.2 app/helpers/admin/taxons_helper.rb
spree_core-0.60.4 app/helpers/admin/taxons_helper.rb
spree_core-0.60.3 app/helpers/admin/taxons_helper.rb
spree_core-0.70.1 app/helpers/admin/taxons_helper.rb
spree_core-0.70.0 app/helpers/admin/taxons_helper.rb
spree_core-0.60.2 app/helpers/admin/taxons_helper.rb
spree_core-0.70.0.rc2 app/helpers/admin/taxons_helper.rb