supplier client sections working with problematic authentication still active
This commit is contained in:
@@ -29,7 +29,7 @@ module Suppliers
|
||||
# GET /products/new
|
||||
# GET /products/new.json
|
||||
def new
|
||||
@product = Product.new
|
||||
@product = Product.new supplier: current_supplier
|
||||
@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|
|
||||
@@ -46,7 +46,7 @@ module Suppliers
|
||||
# POST /products
|
||||
# POST /products.json
|
||||
def create
|
||||
#@product = Product.new(product_params)
|
||||
@product = Product.new(product_params)
|
||||
@product.supplier = current_supplier
|
||||
|
||||
respond_to do |format|
|
||||
@@ -79,7 +79,7 @@ module Suppliers
|
||||
# DELETE /products/1
|
||||
# DELETE /products/1.json
|
||||
def destroy
|
||||
#@product = Product.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
|
||||
@product = Product.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
|
||||
@product.destroy
|
||||
head :no_content
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user