From 83b8d726324be48f32807b36cf9d4371038ff7f1 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 26 Jul 2017 15:04:35 +0630 Subject: [PATCH] update add order --- .../api/restaurant/menu_categories.rb | 37 ---- .../api/restaurant/menu_controller.rb | 2 +- .../origami/addorders_controller.rb | 1 + app/views/origami/addorders/show.html.erb | 163 ++++++++++++------ app/views/origami/home/show.html.erb | 2 +- config/routes.rb | 2 +- 6 files changed, 111 insertions(+), 96 deletions(-) delete mode 100644 app/controllers/api/restaurant/menu_categories.rb diff --git a/app/controllers/api/restaurant/menu_categories.rb b/app/controllers/api/restaurant/menu_categories.rb deleted file mode 100644 index fe7983ea..00000000 --- a/app/controllers/api/restaurant/menu_categories.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Api::Restaurant::MenuController < Api::ApiController - - #Description - # Pull the default menu details and also other available (active) menus - # Input Params - order_id - def index - @menus = Menu.all - @current_menu = Menu.current_menu - - end - - #Description - # This API show current order details - # Input Params - menu_id - def show - @menu = menu_detail(params[:id]) - end - - - private - def menu_detail (menu_id) - if (menu_id) - #Pull this menu - menu = Menu.find_by_id(menu_id) - return menu - else - Menu.current_menu - end - - end - - def menu_params() - params.permit(:id) - end - - -end diff --git a/app/controllers/api/restaurant/menu_controller.rb b/app/controllers/api/restaurant/menu_controller.rb index fe7983ea..169cc1fd 100644 --- a/app/controllers/api/restaurant/menu_controller.rb +++ b/app/controllers/api/restaurant/menu_controller.rb @@ -1,5 +1,5 @@ class Api::Restaurant::MenuController < Api::ApiController - + skip_before_action :authenticate #Description # Pull the default menu details and also other available (active) menus # Input Params - order_id diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb index 68a15c71..e65b24b7 100644 --- a/app/controllers/origami/addorders_controller.rb +++ b/app/controllers/origami/addorders_controller.rb @@ -10,6 +10,7 @@ class Origami::AddordersController < BaseOrigamiController def show @menu = MenuCategory.all + @table_id = params[:id] end private diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index c4f51c1e..049ba371 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -1,65 +1,42 @@
-
-
+
+
-
+
-
ORDER DETAILS | Table 21
+
ORDER DETAILS | Table <%=@table_id%>
- - -
+
@@ -90,21 +67,95 @@ - + + diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 92b37cf9..8281a16e 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -579,6 +579,6 @@ function show_customer_details(customer_id){ $('#add_order').on('click',function(){ var dining_id = "<%= @dining.id %>" - window.location.href = '/origami/addorders/'+dining_id; + window.location.href = '/origami/addorders/'+ dining_id; }); diff --git a/config/routes.rb b/config/routes.rb index e4723a22..310ae0f0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -30,7 +30,7 @@ Rails.application.routes.draw do namespace :restaurant do get 'zones' => "zones#index" resources :menu, only:[:index, :show] - resources :menu_categories, only: [:index] + resources :menu_categories, only: [:index, :show] resources :menu_items, only: [:index, :show] resources :menu_item_attributes, only: [:index] resources :menu_item_options, only: [:index]