end of day commit

This commit is contained in:
2013-01-10 01:00:59 +01:00
parent b85bbf1aee
commit 87046c872c
23 changed files with 642 additions and 28 deletions
@@ -15,7 +15,7 @@ module Suppliers
# GET /products/1
# GET /products/1.json
def show
@product = ProductDecorator.find(params[:id])
@product = ProductDecorator.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
respond_to do |format|
format.html # show.html.erb
@@ -27,6 +27,7 @@ module Suppliers
# GET /products/new.json
def new
@product = Product.new
@product.add_product_category ProductCategory.find_by_supplier_id_and_id!(current_supplier.id, params[:product_category_id]) if params[:product_category_id].present?
respond_to do |format|
format.html # new.html.erb
@@ -59,7 +60,7 @@ module Suppliers
# PUT /products/1
# PUT /products/1.json
def update
@product = Product.find(params[:id])
@product = Product.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
respond_to do |format|
if @product.update_attributes(params[:product])
@@ -75,7 +76,7 @@ module Suppliers
# DELETE /products/1
# DELETE /products/1.json
def destroy
@product = Product.find(params[:id])
@product = Product.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
@product.destroy
respond_to do |format|