constraint to min_qty

This commit is contained in:
PhyoTheingi
2017-06-01 18:44:30 +06:30
parent 166e416277
commit 7020d4957a
3 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
class Settings::SimpleMenuItemsController < ApplicationController
before_action :set_settings_menu_item, only: [:show, :edit, :update, :destroy]
before_action :set_settings_menu_category, only: [:index, :show, :edit, :new, :update]
before_action :set_settings_menu_item, only: [:show, :edit, :update, :destroy ]
before_action :set_settings_menu_category, only: [:index, :show, :edit, :new, :update ,:create]
# GET /settings/menu_items
# GET /settings/menu_items.json
def index

View File

@@ -3,6 +3,7 @@ class MenuItem < ApplicationRecord
has_many :menu_item_instances
belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true
has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
validates_presence_of :item_code, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item
default_scope { order('item_code asc') }

View File

@@ -13,5 +13,5 @@
<li>New</li>
</ul>
</div>
<%= render 'form', settings_menu_item: @settings_menu_item %>
<%= render 'form', settings_set_menu_item: @settings_menu_item %>
</div>