summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2017-03-02 00:22:09 +0100
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2017-03-02 00:22:09 +0100
commitc21d238a97502eb252756722084e73b3f264c0dd (patch)
treea524fec655c6725b28830aae92cb7d5cc17cc081
parentafc25fbc7d02a6f2bf40e4c0673cdc61fc0d96ec (diff)
downloadecs-c21d238a97502eb252756722084e73b3f264c0dd.tar.gz
ecs-c21d238a97502eb252756722084e73b3f264c0dd.zip
Routes.
-rw-r--r--config/routes.rb94
1 files changed, 26 insertions, 68 deletions
diff --git a/config/routes.rb b/config/routes.rb
index a53932a..da0ae9a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -17,91 +17,49 @@ Rails.application.routes.draw do
# You should have received a copy of the GNU Affero General Public
# License along with ECS. If not, see <http://www.gnu.org/licenses/>.
-
-
-#Ecs::Application.routes.draw do
-
namespace :admin do
- resources :participants
- resources :communities
+ resources :participants do
+ post 'reset', on: :member
+ end
+ resources :communities do
+ resources :participants
+ end
resources :organizations
resources :ressources
end
scope :path => '/sys', :as => 'sys' do
- resources :memberships, :only => [:index] do
- match :fifo, :via => [:get, :post], :on => :collection
- end
+ resources :memberships, :only => [:index]
resources :events, :only => [:index] do
match :fifo, :via => [:get, :post], :on => :collection
end
+ resources :configs, :only => [:index, :create]
+ resources :subparticipants, :only => [:index, :show, :create, :update, :destroy]
end
-# begin
-# Admin::Ressource.all.each do |r|
-# scope :path => "/#{r.namespace}", :as => r.namespace do
-# resources r.ressource.to_sym, :controller => :messages, :only => [:index, :show, :create, :update, :destroy] do
-# match :fifo, :via => [:get, :post], :on => :collection
-# match :lifo, :via => [:get, :post], :on => :collection
-# match :details, :via => [:get], :on => :collection
-# match :details, :via => [:get], :on => :member
-# end
-# end
-# end
-# rescue ActiveRecord::StatementInvalid
-# Rails.logger.info "DB error: #{$!}"
-# end
+begin
+ Ressource.all.each do |r|
+ scope :path => "/#{r.namespace}", :as => r.namespace do
+ resources r.ressource.to_sym, :controller => :messages, :only => [:index, :show, :create, :update, :destroy] do
+ match :fifo, :via => [:get, :post], :on => :collection
+ match :lifo, :via => [:get, :post], :on => :collection
+ match :details, :via => [:get], :on => :collection
+ match :details, :via => [:get], :on => :member
+ end
+ end
+ end
+rescue ActiveRecord::StatementInvalid
+ Rails.logger.info "DB error: #{$!}"
+end
# deprecated routes
-resources :memberships, :only => [:index] do
- match :fifo, :via => [:get, :post], :on => :collection
-end
+resources :memberships, :only => [:index]
resources :events, :only => [:index] do
match :fifo, :via => [:get, :post], :on => :collection
end
-
-#end
-
-
-## ActionController::Routing::Routes.draw do |map|
-##
-##
-## map.namespace(:admin) do |admin|
-## admin.resources :participants, :member => { :reset => :post }
-## admin.resources :communities, :has_many => :participants
-## admin.resources :organizations
-## admin.resources :ressources
-## end
-##
-## map.resources :memberships, :only => [:index]
-## map.resources :events, :only => [:index],
-## :collection => { :fifo => [:get, :post] }
-## map.resources :memberships, :path_prefix => '/sys', :name_prefix => 'sys_',
-## :only => [:index]
-## map.resources :events, :path_prefix => '/sys', :name_prefix => 'sys_',
-## :only => [:index], :collection => { :fifo => [:get, :post] }
-## map.resources :configs, :path_prefix => '/sys', :name_prefix => 'sys_',
-## :only => [:index, :create]
-## map.resources :subparticipants, :path_prefix => '/sys', :name_prefix => 'sys_',
-## :only => [:index, :show, :create, :update, :destroy]
-##
-## begin
-## Ressource.all.each do |r|
-## map.resources r.ressource.to_sym, :path_prefix => '/'+r.namespace,
-## :name_prefix => r.namespace+'_', :controller => 'messages',
-## :only => [:index, :show, :create, :update, :destroy],
-## :collection => { :fifo => [:get, :post], :lifo => [:get, :post], :details => :get },
-## :member => { :details => :get }
-## end
-## rescue ActiveRecord::StatementInvalid
-## Rails.logger.info "DB error: #{$!}"
-## end
-##
-## map.connect '/admin', :controller => 'admin/participants', :action => 'default'
-## map.root :controller => 'admin/participants', :action => 'default'
-## end
-
+get '/admin' => 'admin/participants#index'
+root 'admin/participants#index'
# The priority is based upon order of creation: first created -> highest priority.