Files
sx-fc/app/controllers/api/restaurant/menu_controller.rb
2017-04-15 17:33:45 +06:30

38 lines
632 B
Ruby

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