def admin_add
      return if !user_is_allowed('products', 'add')
      
      resp = Caboose::StdClass.new
      name = params[:name]
            
      if name.length == 0
        resp.error = "The name cannot be empty."
      elsif ModificationValueInputField.where(:modification_value_id => params[:mod_value_id], :name => name).exists?
        resp.error = "An input field with that name already exists for this modification value."
      else
        last_ip = ModificationValueInputField.where(:modification_value_id => params[:mod_value_id]).reorder("sort_order desc").limit(1).first
        sort_order = last_ip ? last_ip.sort_order + 1 : 0
        ip = ModificationValueInputField.new(:modification_value_id => params[:mod_value_id], :name => name, :sort_order => sort_order)                  
        ip.save
        resp.success = true        
      end
      render :json => resp    
    end
def admin_add
      return if !user_is_allowed('products', 'add')
      
      resp = Caboose::StdClass.new
      name = params[:name]
            
      if name.length == 0
        resp.error = "The name cannot be empty."
      elsif ModificationValueInputField.where(:modification_value_id => params[:mod_value_id], :name => name).exists?
        resp.error = "An input field with that name already exists for this modification value."
      else
        last_ip = ModificationValueInputField.where(:modification_value_id => params[:mod_value_id]).reorder("sort_order desc").limit(1).first
        sort_order = last_ip ? last_ip.sort_order + 1 : 0
        ip = ModificationValueInputField.new(:modification_value_id => params[:mod_value_id], :name => name, :sort_order => sort_order)                  
        ip.save
        resp.success = true        
      end
      render :json => resp    
    end
POST /admin/products/:product_id/modifications/:mod_id/values/:mod_value_id/input-fields