]> source.dussan.org Git - redmine.git/commitdiff
route: use constraints for repositories ":format => 'raw'" and :action
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 27 Apr 2012 16:17:17 +0000 (16:17 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 27 Apr 2012 16:17:17 +0000 (16:17 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9547 e93f8b46-1217-0410-a6f0-8f06a7374b81

config/routes.rb

index ed26767e3ce4d163af0eeb764a373398bd3da6fd..6757caa87b53075f34056d6b29de3668f73146ef 100644 (file)
@@ -254,12 +254,28 @@ RedmineApp::Application.routes.draw do
             :action => /(browse|show|entry|changes|annotate|diff)/,
             :rev    => /[a-z0-9\.\-_]+/
           }
-  get 'projects/:id/repository/:repository_id/:format(/*path(.:ext))', :to => 'repositories#entry', :format => /raw/
-  get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', :controller => 'repositories', :action => /(browse|show|entry|changes|annotate|diff)/
+  get 'projects/:id/repository/:repository_id/:format(/*path(.:ext))',
+      :to => 'repositories#entry',
+      :constraints => {
+            :format => 'raw'
+          }
+  get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
+      :controller => 'repositories',
+      :constraints => {
+            :action => /(browse|entry|changes|annotate|diff)/
+          }
   get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
 
-  get 'projects/:id/repository/:format(/*path(.:ext))', :to => 'repositories#entry', :format => /raw/
-  get 'projects/:id/repository/:action(/*path(.:ext))', :controller => 'repositories', :action => /(browse|show|entry|changes|annotate|diff)/
+  get 'projects/:id/repository/:format(/*path(.:ext))',
+      :to => 'repositories#entry',
+      :constraints => {
+            :format => 'raw'
+          }
+  get 'projects/:id/repository/:action(/*path(.:ext))',
+      :controller => 'repositories',
+      :constraints => {
+            :action => /(browse|entry|changes|annotate|diff)/
+          }
   get 'projects/:id/repository', :to => 'repositories#show', :path => nil
 
   # additional routes for having the file name at the end of url