forked from turingschool-projects/little_shop_v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
58 lines (42 loc) · 1.38 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Roles: 0 - User
1 - Admin
2 - Merchant
Status - 0 -pending
1 - packaged
2 - shipped
3 - cancelled
Rails.application.routes.draw do
root 'welcome#index'
get '/login', to: 'sessions#new', as: :login
get '/logout', to: 'sessions#destroy', as: :logout
get '/register', to: 'users#new', as: :register
get '/profile', to: 'users#show', as: :profile
get '/profile/edit', to: 'users#edit', as: :profile_edit
scope :profile, as: :profile, module: :profile do
resources :orders, only: [:index, :show]
end
get '/cart', to: 'carts#show', as: :cart
resources :items, only: [:index, :show]
scope :dashboard, as: :dashboard, module: :merchant do
root 'merchants#dashboard'
resources :items, only: [:index, :new, :edit, :show]
resources :orders, only: [:show]
end
resources :merchants, only: [:index, :show]
namespace :admin do
get '/dashboard', to: 'users#dashboard'
resources :users, only: :show do
resources :orders, only: [:index, :show]
end
resources :users, only: [:index, :edit, :show]
resources :merchants, only: :show do
resources :orders, only: :show, scope: :merchant_show
resources :items, only: [:index, :new, :edit]
end
end
# scope :admin, module: :admin, as: :admin do
# resources :categories, only: :index
# end
patch '/profile/edit', to: 'users#update'
resources :users, only: [:create]
end