Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant into august_spring

This commit is contained in:
Nweni
2017-08-22 14:12:04 +06:30
39 changed files with 1413 additions and 945 deletions

View File

@@ -1,5 +1,5 @@
class Origami::CommissionsController < BaseOrigamiController
# before_action :set_commission, only: [:show, :edit, :update, :destroy]
before_action :set_commission, only: [:show, :edit, :update, :destroy]
# GET /commissions
# GET /commissions.json

View File

@@ -0,0 +1,74 @@
class Origami::ProductCommissionsController < ApplicationController
before_action :set_product_commission, only: [:show, :edit, :update, :destroy]
# GET /product_commissions
# GET /product_commissions.json
def index
@product_commissions = ProductCommission.all
end
# GET /product_commissions/1
# GET /product_commissions/1.json
def show
end
# GET /product_commissions/new
def new
@product_commission = ProductCommission.new
end
# GET /product_commissions/1/edit
def edit
end
# POST /product_commissions
# POST /product_commissions.json
def create
@product_commission = ProductCommission.new(product_commission_params)
respond_to do |format|
if @product_commission.save
format.html { redirect_to @product_commission, notice: 'Product commission was successfully created.' }
format.json { render :show, status: :created, location: @product_commission }
else
format.html { render :new }
format.json { render json: @product_commission.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /product_commissions/1
# PATCH/PUT /product_commissions/1.json
def update
respond_to do |format|
if @product_commission.update(product_commission_params)
format.html { redirect_to @product_commission, notice: 'Product commission was successfully updated.' }
format.json { render :show, status: :ok, location: @product_commission }
else
format.html { render :edit }
format.json { render json: @product_commission.errors, status: :unprocessable_entity }
end
end
end
# DELETE /product_commissions/1
# DELETE /product_commissions/1.json
def destroy
@product_commission.destroy
respond_to do |format|
format.html { redirect_to product_commissions_url, notice: 'Product commission was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_product_commission
@product_commission = ProductCommission.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def product_commission_params
params.fetch(:product_commission, {})
end
end