Module: Spree::Admin::ProductsHelper
- Defined in:
- app/helpers/spree/admin/products_helper.rb
Instance Method Summary collapse
- #option_types_options_for(product) ⇒ Object
- #show_rebuild_vat_checkbox? ⇒ Boolean
- #taxon_options_for(product) ⇒ Object
Instance Method Details
#option_types_options_for(product) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/spree/admin/products_helper.rb', line 16 def (product) @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() end |
#show_rebuild_vat_checkbox? ⇒ Boolean
28 29 30 |
# File 'app/helpers/spree/admin/products_helper.rb', line 28 def show_rebuild_vat_checkbox? Spree::TaxRate.included_in_price.exists? end |
#taxon_options_for(product) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/spree/admin/products_helper.rb', line 4 def (product) = @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() end |