Sha256: 6122bdaf2df974938dace63e2d7bdedc60c82b557e47a777832365d9764f56ec
Contents?: true
Size: 1.12 KB
Versions: 62
Compression:
Stored size: 1.12 KB
Contents
module Workarea module Storefront module ProductsHelper def truncated_product_description(product, text) truncate(strip_tags(product.description), length: 200) do link_to( text, product_path( product, params: product.browse_link_options, anchor: 'description' ), data: { scroll_to_button: '' } ) end end def option_label(option) if option.current.present? "#{option.name}: #{option.current}" else option.name end end def option_selection_url_for(product, option, selection) selection_value = option.current == selection ? nil : selection product.currently_selected_options.merge( option.slug => selection_value, id: product.slug, via: params[:via] ) end def intrinsic_ratio_product_image_styles(image) return if image.inverse_aspect_ratio.blank? "padding-bottom: #{image.inverse_aspect_ratio * 100}%;" end end end end
Version data entries
62 entries across 62 versions & 1 rubygems