diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-04-27 16:17:17 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-04-27 16:17:17 +0000 |
commit | 8047a8cd28d750ae5e97447666b91e6118f40529 (patch) | |
tree | 30e24da1b274a704610e69613ba8ae74f84b66ab /config | |
parent | dd23e07111ae3190f0abd557ef470be51d5d0acf (diff) | |
download | redmine-8047a8cd28d750ae5e97447666b91e6118f40529.tar.gz redmine-8047a8cd28d750ae5e97447666b91e6118f40529.zip |
route: use constraints for repositories ":format => 'raw'" and :action
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9547 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config')
-rw-r--r-- | config/routes.rb | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/config/routes.rb b/config/routes.rb index ed26767e3..6757caa87 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 |