124 lines
4.6 KiB
Ruby
124 lines
4.6 KiB
Ruby
Qrammer::Application.routes.draw do
|
|
devise_for :users
|
|
devise_for :suppliers
|
|
devise_for :administrators
|
|
|
|
#authenticate :administrator do
|
|
resources :users
|
|
resources :tables
|
|
resources :orders do
|
|
member do
|
|
post :is_being_processed
|
|
post :is_delivered
|
|
end
|
|
end
|
|
resources :suppliers
|
|
resources :lists
|
|
resources :products
|
|
resources :product_categories
|
|
#end
|
|
|
|
get '/supplier' => 'supplier#home', as: :supplier_root
|
|
get '/supplier/active_orders' => 'supplier#active_orders', as: :supplier_active_orders
|
|
get '/supplier/active_lists' => 'supplier#active_lists', as: :supplier_active_lists
|
|
get 'supplier/lists/:list_id' => 'supplier#show_list', as: :supplier_show_list
|
|
|
|
post '/supplier/close_list' => 'supplier#close_list', as: :supplier_close_list
|
|
post '/supplier/mark_list_as_helped' => 'supplier#mark_list_as_helped', as: :supplier_mark_list_as_helped
|
|
|
|
post '/supplier/mark_order_in_process' => 'supplier#mark_order_in_process', as: :supplier_mark_order_in_process
|
|
post '/supplier/order_is_delivered' => 'supplier#order_is_delivered', as: :supplier_order_is_delivered
|
|
|
|
post '/supplier/mark_as_open' => 'supplier#mark_as_open', as: :supplier_mark_as_open
|
|
post '/supplier/mark_as_closed' => 'supplier#mark_as_closed', as: :supplier_mark_as_closed
|
|
|
|
get '/supplier/settings' => 'supplier#edit', as: :supplier_settings
|
|
match '/supplier/settings' => 'supplier#update', as: :supplier_update_settings, via: [:put, :post]
|
|
|
|
match '/user' => 'user#home', as: :user_root
|
|
get '/user/active_list(.:format)' => 'user#active_list', as: :user_active_list
|
|
get '/user/list_info' => 'user#list_info', as: :user_list_info
|
|
post '/user/needs_help' => 'user#needs_help', as: :user_needs_help
|
|
post '/user/list_needs_payment' => 'user#list_needs_payment', as: :user_list_needs_payment
|
|
match '/user/create_list' => 'user#create_list', as: :user_create_list
|
|
get '/user/list_products' => 'user#list_products', as: :user_list_products
|
|
get '/user/list_products_for_table' => 'user#list_products_for_table', as: :user_list_products_for_table
|
|
match '/user/list_history' => 'user#list_history', as: :user_list_history
|
|
match '/user/list_history/:list_id' => 'user#history_list', as: :user_history_list
|
|
post '/user/order_selected_products' => 'user#order_selected_products', as: :user_order_selected_products
|
|
post '/user/move_table' => 'user#move_table', as: :user_move_table
|
|
get '/user/table_info' => 'user#table_info', as: :user_table_info
|
|
|
|
match '/show_products' => 'dashboard#show_products', as: :user_products
|
|
|
|
namespace :suppliers, path: '/supplier' do
|
|
resources :sections
|
|
resources :tables
|
|
resources :products
|
|
resources :product_categories
|
|
root to: 'sections#index'
|
|
end
|
|
|
|
#DEMO & DEVELOPMENT
|
|
get '/select_qrcode' => 'dashboard#select_qrcode'
|
|
get '/table_qr_image' => 'dashboard#table_qr_image', as: :table_qr_image
|
|
#match "/:action", controller: 'dashboard'
|
|
|
|
# The priority is based upon order of creation:
|
|
# first created -> highest priority.
|
|
|
|
# Sample of regular route:
|
|
# match 'products/:id' => 'catalog#view'
|
|
# Keep in mind you can assign values other than :controller and :action
|
|
|
|
# Sample of named route:
|
|
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
|
# This route can be invoked with purchase_url(:id => product.id)
|
|
|
|
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
|
# resources :products
|
|
|
|
# Sample resource route with options:
|
|
# resources :products do
|
|
# member do
|
|
# get 'short'
|
|
# post 'toggle'
|
|
# end
|
|
#
|
|
# collection do
|
|
# get 'sold'
|
|
# end
|
|
# end
|
|
|
|
# Sample resource route with sub-resources:
|
|
# resources :products do
|
|
# resources :comments, :sales
|
|
# resource :seller
|
|
# end
|
|
|
|
# Sample resource route with more complex sub-resources
|
|
# resources :products do
|
|
# resources :comments
|
|
# resources :sales do
|
|
# get 'recent', :on => :collection
|
|
# end
|
|
# end
|
|
|
|
# Sample resource route within a namespace:
|
|
# namespace :admin do
|
|
# # Directs /admin/products/* to Admin::ProductsController
|
|
# # (app/controllers/admin/products_controller.rb)
|
|
# resources :products
|
|
# end
|
|
|
|
# You can have the root of your site routed with "root"
|
|
# just remember to delete public/index.html.
|
|
root :to => 'dashboard#home'
|
|
|
|
# See how all your routes lay out with "rake routes"
|
|
|
|
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
|
# Note: This route will make all actions in every controller accessible via GET requests.
|
|
# match ':controller(/:action(/:id))(.:format)'
|
|
end
|