2024-01-11 19:40:58 -06:00
|
|
|
Rails.application.routes.draw do
|
2024-01-14 22:28:10 -06:00
|
|
|
devise_for :users
|
|
|
|
|
2024-01-14 23:57:43 -06:00
|
|
|
authenticated :user do
|
|
|
|
root 'home#index', as: :authenticated_root
|
|
|
|
end
|
|
|
|
|
2024-02-15 17:23:54 -06:00
|
|
|
authenticate :user, lambda { |u| u.admin? } do
|
|
|
|
resources :users, only: [:index, :edit, :update, :destroy]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2024-01-14 23:57:43 -06:00
|
|
|
devise_scope :user do
|
|
|
|
root to: 'devise/sessions#new'
|
|
|
|
end
|
|
|
|
|
2024-01-22 22:57:37 -06:00
|
|
|
resources :participants do
|
2024-02-16 23:36:48 -06:00
|
|
|
resources :onboardings, only: [:index, :create, :update] do
|
|
|
|
collection do
|
|
|
|
post 'submit_onboarding'
|
|
|
|
end
|
|
|
|
end
|
2024-02-12 17:26:45 -06:00
|
|
|
resources :bank_accounts, only: [:index, :new, :create, :edit, :update, :destroy]
|
2024-02-02 16:44:50 -06:00
|
|
|
collection do
|
|
|
|
get 'search' # Define search on the collection, not on a member
|
|
|
|
end
|
2024-01-22 22:57:37 -06:00
|
|
|
member do
|
2024-02-02 16:44:50 -06:00
|
|
|
post 'link_worker' # Other member routes
|
2024-02-16 23:36:48 -06:00
|
|
|
post 'link_vendor'
|
2024-01-22 22:57:37 -06:00
|
|
|
end
|
|
|
|
end
|
2024-01-23 19:14:58 -06:00
|
|
|
|
2024-02-02 16:44:50 -06:00
|
|
|
|
2024-02-16 23:36:48 -06:00
|
|
|
resources :workers do
|
2024-02-17 02:42:12 -06:00
|
|
|
resources :onboardings, only: [:index, :create, :update] do
|
|
|
|
collection do
|
|
|
|
post 'submit_onboarding'
|
|
|
|
end
|
|
|
|
end
|
2024-02-16 23:36:48 -06:00
|
|
|
resources :bank_accounts, only: [:index, :new, :create, :edit, :update, :destroy]
|
2024-02-02 16:44:50 -06:00
|
|
|
member do
|
|
|
|
post 'link_participant'
|
2024-02-05 16:48:36 -06:00
|
|
|
post 'link_employer'
|
2024-02-02 16:44:50 -06:00
|
|
|
end
|
2024-01-29 21:03:16 -06:00
|
|
|
get 'search', on: :collection
|
|
|
|
end
|
|
|
|
|
2024-02-02 16:44:50 -06:00
|
|
|
|
2024-01-31 02:19:24 -06:00
|
|
|
resources :vendors do
|
2024-02-17 02:42:12 -06:00
|
|
|
resources :onboardings, only: [:index, :create, :update] do
|
|
|
|
collection do
|
|
|
|
post 'submit_onboarding'
|
|
|
|
end
|
|
|
|
end
|
2024-02-16 23:36:48 -06:00
|
|
|
resources :bank_accounts, only: [:index, :new, :create, :edit, :update, :destroy]
|
2024-01-31 02:19:24 -06:00
|
|
|
collection do
|
|
|
|
get 'search'
|
|
|
|
end
|
|
|
|
end
|
2024-02-12 17:26:45 -06:00
|
|
|
|
2024-01-31 02:19:24 -06:00
|
|
|
|
2024-01-23 00:14:10 -06:00
|
|
|
resources :employments, only: [:edit, :update, :destroy]
|
2024-02-05 18:49:36 -06:00
|
|
|
|
2024-02-02 23:12:36 -06:00
|
|
|
resources :employer_records, only: [:edit, :update, :destroy] do
|
2024-02-05 18:49:36 -06:00
|
|
|
post 'link_participant', on: :collection
|
2024-02-02 23:12:36 -06:00
|
|
|
end
|
2024-02-05 18:49:36 -06:00
|
|
|
|
2024-01-31 02:19:24 -06:00
|
|
|
resources :service_contracts
|
|
|
|
|
2024-01-19 23:38:15 -06:00
|
|
|
resources :employers do
|
2024-02-17 02:42:12 -06:00
|
|
|
resources :onboardings, only: [:index, :create, :update] do
|
|
|
|
collection do
|
|
|
|
post 'submit_onboarding'
|
|
|
|
end
|
|
|
|
end
|
2024-02-05 18:49:36 -06:00
|
|
|
member do
|
2024-02-17 02:42:12 -06:00
|
|
|
post 'link_worker'
|
|
|
|
end
|
|
|
|
collection do
|
|
|
|
get 'search'
|
2024-02-05 18:49:36 -06:00
|
|
|
end
|
2024-01-19 23:38:15 -06:00
|
|
|
end
|
2024-02-17 02:42:12 -06:00
|
|
|
|
2024-02-15 17:23:54 -06:00
|
|
|
|
|
|
|
resources :forms
|
|
|
|
resources :users
|
2024-04-03 18:32:15 -05:00
|
|
|
|
2024-04-12 02:40:09 -05:00
|
|
|
# Setup the routes under a scope to mimic namespace-like behavior without actual namespacing
|
|
|
|
scope '/admin', controller: :admin do
|
|
|
|
get 'users/new', as: 'new_admin_user', action: :new_user # for displaying the new user form
|
|
|
|
post 'users', as: 'admin_users', action: :create_user # for submitting the new user form
|
|
|
|
# You can add more admin routes here as needed
|
2024-04-11 23:48:16 -05:00
|
|
|
end
|
2024-04-12 02:40:09 -05:00
|
|
|
|
2024-04-11 23:48:16 -05:00
|
|
|
|
2024-04-12 02:40:09 -05:00
|
|
|
|
2024-01-14 22:28:10 -06:00
|
|
|
|
2024-01-14 23:57:43 -06:00
|
|
|
get 'home/index'
|
2024-01-11 19:40:58 -06:00
|
|
|
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Defines the root path route ("/")
|
|
|
|
# root "posts#index"
|
|
|
|
end
|