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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Rails.application.routes.draw do
# get "tags/index", to: "tags#index"
# get "tags/new", to: "tags#new"
# get "tags/create", to: "tags#create"
# get "tags/edit", to: "tags#edit"
# get "tags/update", to: "tags#update"
# get "tags/destroy", to: "tags#destroy"
# get "images/index", to: "images#index"
# get "images/show", to: "images#show"
# get "images/new", to: "images#new"
# get "images/create", to: "images#create"
# get "images/edit", to: "images#edit"
# get "images/update", to: "images#update"
# get "images/destroy", to: "images#destroy"
# get "images/search", to: "images#search"
# get "sessions/index", to: "sessions#index"
# get "sessions/show", to: "sessions#show"
# get "session/new", to: "sessions#new"
# get "sessions/security", to: "sessions#security"
# Authentication routes
resource :session
resources :sessions, only: [ :index, :show ] do
member do
delete :destroy_session
end
collection do
get :security
patch :update_security
post :terminate_all
end
end
resources :passwords, param: :token
resources :users, only: [ :new, :create ]
# Image management routes
resources :images do
collection do
get :search
end
member do
patch :approve
patch :reject
end
end
# Tag management routes
resources :tags, except: [ :show ] do
resources :images, only: [ :index, :new, :create ]
end
# Admin namespace for admin-only actions
namespace :admin do
# get "users/index", to: "users#index"
# get "users/show", to: "users#show"
# get "users/edit", to: "users#edit"
# get "users/update", to: "users#update"
# get "users/destroy", to: "users#destroy"
# get "images/index", to: "images#index"
# get "images/show", to: "images#show"
# get "images/update", to: "images#update"
# get "images/destroy", to: "images#destroy"
# get "images/pending", to: "images#pending"
# get "images/approved", to: "images#approved"
# get "images/rejected", to: "images#rejected"
# get "images/approve", to: "images#approve"
# get "images/reject", to: "images#reject"
# get "images/add_tags", to: "images#add_tags"
# get "images/remove_tag", to: "images#remove_tag"
# get "dashboard/index", to: "dashboard#index"
resources :images, only: [ :index, :show, :new, :create, :edit, :update, :destroy ] do
member do
patch :approve
patch :reject
post :add_tags
delete :remove_tag
end
collection do
get :pending
get :approved
get :rejected
end
end
resources :users, only: [ :index, :show, :edit, :update, :destroy ]
resources :tags, only: [ :index, :create, :update, :destroy ] do
resources :images, only: [ :index, :new, :create ]
end
root to: "dashboard#index"
end
# Example route (can be removed later)
get "inertia-example", to: "inertia_example#index"
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
# Can be used by load balancers and uptime monitors to verify that the app is live.
get "up" => "rails/health#show", as: :rails_health_check
# Root path route
root "images#index"
end