summaryrefslogtreecommitdiffstats
path: root/config/routes.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-04-27 16:17:03 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-04-27 16:17:03 +0000
commitdd23e07111ae3190f0abd557ef470be51d5d0acf (patch)
treeaf153f955269e07d62077246cde7b380cb60d7fc /config/routes.rb
parentd7e14cb7b757c5cdb52105197e40202de0db2636 (diff)
downloadredmine-dd23e07111ae3190f0abd557ef470be51d5d0acf.tar.gz
redmine-dd23e07111ae3190f0abd557ef470be51d5d0acf.zip
route: add constraints to repositories which are lost in Rails3 route
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9546 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb28
1 files changed, 24 insertions, 4 deletions
diff --git a/config/routes.rb b/config/routes.rb
index d2f1cc22c..ed26767e3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -220,8 +220,18 @@ RedmineApp::Application.routes.draw do
post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
- get 'projects/:id/repository/:repository_id/revisions/:rev/:format(/*path(.:ext))', :to => 'repositories#entry', :format => /raw/
- get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', :controller => 'repositories', :action => /(browse|show|entry|changes|annotate|diff)/
+ get 'projects/:id/repository/:repository_id/revisions/:rev/:format(/*path(.:ext))',
+ :to => 'repositories#entry',
+ :constraints => {
+ :format => 'raw',
+ :rev => /[a-z0-9\.\-_]+/
+ }
+ get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))',
+ :controller => 'repositories',
+ :constraints => {
+ :action => /(browse|show|entry|changes|annotate|diff)/,
+ :rev => /[a-z0-9\.\-_]+/
+ }
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
get 'projects/:id/repository/graph', :to => 'repositories#graph'
@@ -232,8 +242,18 @@ RedmineApp::Application.routes.draw do
get 'projects/:id/repository/revision', :to => 'repositories#revision'
post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
- get 'projects/:id/repository/revisions/:rev/:format(/*path(.:ext))', :to => 'repositories#entry', :format => /raw/
- get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', :controller => 'repositories', :action => /(browse|show|entry|changes|annotate|diff)/
+ get 'projects/:id/repository/revisions/:rev/:format(/*path(.:ext))',
+ :to => 'repositories#entry',
+ :constraints => {
+ :format => 'raw',
+ :rev => /[a-z0-9\.\-_]+/
+ }
+ get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))',
+ :controller => 'repositories',
+ :constraints => {
+ :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', :to => 'repositories#show', :path => nil