app/controllers/products_controller.rb
def add_dependent(dependent)
      unless dependent.blank? || dependent[:product_id].blank?
        @product.dependents << Product.find(dependent[:product_id])
      end    
    end
# Adds new dependent to product (something that depends on the product)
Adds new dependent to product (something that depends on the product)
Adds new dependent to product ( something that depends on the product )
def add_dependent(dependent)
      unless dependent.blank? || dependent[:product_id].blank?
        @product.dependents << Product.find(dependent[:product_id])
      end    
    end
def add_dependent ( dependent ) unless dependent . blank? || dependent [ :product_id ] . blank? @product . dependents << Product . find ( dependent [ :product_id ] ) end end
Adds new dependent to product (something that depends on the product)
Adds new dependent to product ( something that depends on the product )
dependent