1 Rails.application.routes.draw do
3 # Copyright (C) 2017 Heiko Bernloehr (FreeIT.de).
5 # This file is part of ECS.
7 # ECS is free software: you can redistribute it and/or modify it
8 # under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of
10 # the License, or (at your option) any later version.
12 # ECS is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public
18 # License along with ECS. If not, see <http://www.gnu.org/licenses/>.
21 resources :participants do
22 post 'reset', on: :member
24 resources :communities do
25 resources :participants
27 resources :organizations
31 scope :path => '/sys', :as => 'sys' do
32 resources :memberships, :only => [:index]
33 resources :events, :only => [:index] do
34 match :fifo, :via => [:get, :post], :on => :collection
36 resources :configs, :only => [:index, :create]
37 resources :subparticipants, :only => [:index, :show, :create, :update, :destroy]
41 Ressource.all.each do |r|
42 scope :path => "/#{r.namespace}", :as => r.namespace do
43 resources r.ressource.to_sym, :controller => :messages, :only => [:index, :show, :create, :update, :destroy] do
44 match :fifo, :via => [:get, :post], :on => :collection
45 match :lifo, :via => [:get, :post], :on => :collection
46 match :details, :via => [:get], :on => :collection
47 match :details, :via => [:get], :on => :member
51 rescue ActiveRecord::StatementInvalid
52 Rails.logger.info "DB error: #{$!}"
56 resources :memberships, :only => [:index]
57 resources :events, :only => [:index] do
58 match :fifo, :via => [:get, :post], :on => :collection
61 get '/admin' => 'admin/participants#index'
62 root 'admin/participants#index'
65 # The priority is based upon order of creation: first created -> highest priority.
66 # See how all your routes lay out with "rake routes".
68 # You can have the root of your site routed with "root"
69 # root 'welcome#index'
71 # Example of regular route:
72 # get 'products/:id' => 'catalog#view'
74 # Example of named route that can be invoked with purchase_url(id: product.id)
75 # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
77 # Example resource route (maps HTTP verbs to controller actions automatically):
80 # Example resource route with options:
81 # resources :products do
92 # Example resource route with sub-resources:
93 # resources :products do
94 # resources :comments, :sales
98 # Example resource route with more complex sub-resources:
99 # resources :products do
100 # resources :comments
101 # resources :sales do
102 # get 'recent', on: :collection
106 # Example resource route with concerns:
107 # concern :toggleable do
110 # resources :posts, concerns: :toggleable
111 # resources :photos, concerns: :toggleable
113 # Example resource route within a namespace:
114 # namespace :admin do
115 # # Directs /admin/products/* to Admin::ProductsController
116 # # (app/controllers/admin/products_controller.rb)
117 # resources :products