From 50f157d5039762c6ff9f8cee6bdc502d9a1cb49a Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Wed, 24 Oct 2007 12:15:07 +0000 Subject: [PATCH] ActionItem114: reorganizing routes --- config/routes.rb | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 6a1c52f..978da9e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,6 +11,10 @@ ActionController::Routing::Routes.draw do |map| # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' # This route can be invoked with purchase_url(:id => product.id) + ###################################################### + ## Public controllers + ###################################################### + # You can have the root of your site routed by hooking up '' # -- just remember to delete public/index.html. map.connect '', :controller => "home" @@ -18,16 +22,8 @@ ActionController::Routing::Routes.draw do |map| # documentation browser map.connect 'doc', :controller => 'doc' - ###################################################### - ## Controllers that are used by environment admin - ###################################################### - # administrative tasks for a environment - map.admin 'admin', :controller => 'admin_panel' - map.admin 'admin/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('environment_admin') - # user account controller map.connect 'account/new_password/:code', :controller => 'account', :action => 'new_password' - map.connect 'account/:action', :controller => 'account' # enterprise registration @@ -35,6 +31,10 @@ ActionController::Routing::Routes.draw do |map| # search map.connect 'search', :controller => 'search' + + # categories controller + map.connect 'cat', :controller => 'category', :action => 'index' + map.category 'cat/*path', :controller => 'category', :action => 'view' ###################################################### ## Controllers that are profile-specific (for profile admins ) @@ -42,7 +42,14 @@ ActionController::Routing::Routes.draw do |map| # profile customization - "My profile" map.myprofile 'myprofile/:profile', :controller => 'profile_editor', :action => 'index' map.myprofile 'myprofile/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('profile_admin') - # content administration + + + ###################################################### + ## Controllers that are used by environment admin + ###################################################### + # administrative tasks for a environment + map.admin 'admin', :controller => 'admin_panel' + map.admin 'admin/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('environment_admin') ###################################################### @@ -59,13 +66,6 @@ ActionController::Routing::Routes.draw do |map| ###################################################### map.connect 'test/:controller/:action/:id', :controller => /.*test.*/ - ###################################################### - ## Public controllers - ###################################################### - - map.connect 'cat', :controller => 'category', :action => 'index' - map.category 'cat/*path', :controller => 'category', :action => 'view' - # *content viewing* # XXX this route must come last so other routes have priority over it. map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page' -- libgit2 0.21.2