def admin_update_variant_columns    
      return if !user_is_allowed('products', 'edit')
      session['variant_cols'] = self.default_variant_cols if session['variant_cols'].nil?
      
      resp = Caboose::StdClass.new({'attributes' => {}})
      product = Product.find(params[:id])    
      
      save = true    
      params.each do |name,value|
        value = ActiveRecord::ConnectionAdapters::Column.value_to_boolean(value)
        case name
          when 'option1'        ,
            'option2'           ,
            'option3'           ,
            'status'            ,
            'alternate_id'      ,
            'sku'               ,                        
            'barcode'           , 
            'price'             ,
            'quantity_in_stock' ,
            'weight'            , 
            'length'            , 
            'width'             , 
            'height'            , 
            'cylinder'          , 
            'requires_shipping' ,
            'allow_backorder'   ,
            'taxable'      
            session['variant_cols'][name] = value
        end
      end
      resp.success = save && product.save
      render :json => resp
    end
def admin_update_variant_columns    
      return if !user_is_allowed('products', 'edit')
      session['variant_cols'] = self.default_variant_cols if session['variant_cols'].nil?
      
      resp = Caboose::StdClass.new({'attributes' => {}})
      product = Product.find(params[:id])    
      
      save = true    
      params.each do |name,value|
        value = ActiveRecord::ConnectionAdapters::Column.value_to_boolean(value)
        case name
          when 'option1'        ,
            'option2'           ,
            'option3'           ,
            'status'            ,
            'alternate_id'      ,
            'sku'               ,                        
            'barcode'           , 
            'price'             ,
            'quantity_in_stock' ,
            'weight'            , 
            'length'            , 
            'width'             , 
            'height'            , 
            'cylinder'          , 
            'requires_shipping' ,
            'allow_backorder'   ,
            'taxable'      
            session['variant_cols'][name] = value
        end
      end
      resp.success = save && product.save
      render :json => resp
    end
PUT /admin/products/:id/variant-cols