update commission and seed for font

This commit is contained in:
Aung Myo
2017-11-07 10:31:10 +06:30
parent 3aacc63b82
commit b48625e25e
21 changed files with 312 additions and 23 deletions

View File

@@ -29,6 +29,7 @@ class Settings::CommissionsController < ApplicationController
def create
@commission = Commission.new(commission_params)
@commission.product_type = 'menu_item'
@commission.product_code = "[]"
respond_to do |format|
if @commission.save
@@ -45,6 +46,8 @@ class Settings::CommissionsController < ApplicationController
# PATCH/PUT /commissions/1.json
def update
respond_to do |format|
puts commission_params.to_json
puts "updddddddddddddddddddddd"
if @commission.update(commission_params)
format.html {redirect_to settings_commission_path(@commission), notice: 'Commission was successfully updated.'}
format.json {render :show, status: :ok, location: @commission}
@@ -73,6 +76,6 @@ class Settings::CommissionsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def commission_params
params.require(:commission).permit(:product_type, :product_code, :amount, :commission_type, :is_active)
params.require(:commission).permit(:product_type,:name, :product_code, :amount, :commission_type, :is_active)
end
end