Promotion Product Bug Fix

This commit is contained in:
Phyo
2017-08-24 14:37:11 +06:30
parent 0118a178b2
commit 0670a6a05d
5 changed files with 36 additions and 59 deletions

View File

@@ -4,7 +4,7 @@ class Settings::PromotionsController < ApplicationController
# GET /promotions
# GET /promotions.json
def index
@promotions = Promotion.all
@promotions = Promotion.all.order("created_at asc")
end
# GET /promotions/1
@@ -85,6 +85,6 @@ class Settings::PromotionsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def promotion_params
params.require(:promotion).permit(:promo_code, :promo_start_date, :promo_end_date, :promo_start_hour,:promo_end_hour ,:promo_day, :promo_type,:original_product ,:min_qty ,:created_by,
:promotion_products_attributes => [:item_code, :min_qty, :net_off, :net_price, :percentage, :_destroy])
:promotion_products_attributes => [:id,:item_code, :min_qty, :net_off, :net_price, :percentage, :_destroy])
end
end