app/controllers/products_controller.rb
def new_employee_product(employee_product)
      unless employee_product.blank? || employee_product[:employee_id].blank?
        new_employee_product = @product.employee_products.new(params[:employee_product])
        new_employee_product.save
        flash[:notice] = "Employee allocated"
      end
    end
# Adds new employee allocation to product
Adds new employee allocation to product
Adds new employee allocation to product
def new_employee_product(employee_product)
      unless employee_product.blank? || employee_product[:employee_id].blank?
        new_employee_product = @product.employee_products.new(params[:employee_product])
        new_employee_product.save
        flash[:notice] = "Employee allocated"
      end
    end
def new_employee_product ( employee_product ) unless employee_product . blank? || employee_product [ :employee_id ] . blank? new_employee_product = @product . employee_products . new ( params [ :employee_product ] ) new_employee_product . save flash [ :notice ] = "Employee allocated" end end
Adds new employee allocation to product
Adds new employee allocation to product
employee_product