Sha256: 5b5b8653b25b61d0c12f69aa7fb732e10acdb11cea16e00c6b7cf2896b04ba0e

Contents?: true

Size: 909 Bytes

Versions: 11

Compression:

Stored size: 909 Bytes

Contents

module Spree
  module Admin
    module ProductPropertiesHelper
      # Generates the appropriate field name for attribute_fu.  Normally attribute_fu handles this but we've got a
      # special case where we need text_field_with_autocomplete and we have to recreate attribute_fu's naming
      # scheme manually.
      def property_fu_name(product_property, number)
        if product_property.new_record?
          "product[product_property_attributes][new][#{number}][property_name]"
        else
          "product[product_property_attributes][#{product_property.id}][property_name]"
        end
      end

      def property_fu_value(product_property, number)
        if product_property.new_record?
          "product[product_property_attributes][new][#{number}][value]"
        else
          "product[product_property_attributes][#{product_property.id}][value]"
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spree_core-1.0.7 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.6 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.4 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.3 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.2 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.1 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.0 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.0.rc4 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.0.rc3 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.0.rc2 app/helpers/spree/admin/product_properties_helper.rb
spree_core-1.0.0.rc1 app/helpers/spree/admin/product_properties_helper.rb