app/controllers/spree/admin/option_types_controller_decorator.rb
# AJAX method for selecting an existing option type and associating with the current product
AJAX method for selecting an existing option type and associating with the current product
AJAX method for selecting an existing option type and associating with the current product
def select_ad_hoc
      ad_hoc_option_type = AdHocOptionType.new()
      option_type = OptionType.find params[:id]
      ad_hoc_option_type.option_type = option_type
      ad_hoc_option_type.position = option_type.position
      @product.ad_hoc_option_types << ad_hoc_option_type
      redirect_to edit_admin_ad_hoc_option_type_url(ad_hoc_option_type)
    end
def select_ad_hoc ad_hoc_option_type = AdHocOptionType . new ( ) option_type = OptionType . find params [ :id ] ad_hoc_option_type . option_type = option_type ad_hoc_option_type . position = option_type . position @product . ad_hoc_option_types << ad_hoc_option_type redirect_to edit_admin_ad_hoc_option_type_url ( ad_hoc_option_type ) end
AJAX method for selecting an existing option type and associating with the current product
AJAX method for selecting an existing option type and associating with the current product