Module: Spree::Admin::ProductGroupsHelper

Defined in:
app/helpers/spree/admin/product_groups_helper.rb

Instance Method Summary collapse

Instance Method Details

#product_scope_field(product_scope, i) ⇒ Object

Allow certain scope attributes to have a custom field type



5
6
7
8
9
10
11
# File 'app/helpers/spree/admin/product_groups_helper.rb', line 5

def product_scope_field(product_scope, i)
  value = (product_scope.arguments || [])[i]
  name = 'product_group[product_scopes_attributes][][arguments][]'
  helper_method_for_scope = :product_picker_field if product_scope.name.to_sym == :with_ids
  helper_method_for_scope ||= :text_field_tag
  send(helper_method_for_scope, name, value)
end