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