From 36eefde0405cef572046d293b05efeec82db2591 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 24 Jul 2009 11:26:47 -0300 Subject: [PATCH] ActionItem1178: moving custom domain routing last --- config/routes.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 3d0a545..769dcd8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -84,10 +84,10 @@ ActionController::Routing::Routes.draw do |map| # cache stuff - hack map.cache 'public/:action/:id', :controller => 'public' - # match requests for content in domains hosted for profiles - map.connect '*page', :controller => 'content_viewer', :action => 'view_page', :conditions => { :if => lambda { |env| Domain.hosting_profile_at(env[:host])} } + # match requests for profiles that don't have a custom domain + map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page', :profile => /#{Noosfero.identifier_format}/, :conditions => { :if => lambda { |env| !Domain.hosting_profile_at(env[:host]) } } - # XXX this route must come last so other routes have priority over it. - map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page', :profile => /#{Noosfero.identifier_format}/ + # match requests for content in domains hosted for profiles + map.connect '*page', :controller => 'content_viewer', :action => 'view_page' end -- libgit2 0.21.2