diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-11 17:27:32 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-11 17:27:32 +0000 |
commit | 1b9ca7219bf1906b134aae11d650d9698ea79cb6 (patch) | |
tree | 20016f7d0d6a48fdcf115f9a8c386270ab71ed1b /config | |
parent | d4edd4d6a48da889e7447c80ecccf6f3fb183d98 (diff) | |
download | redmine-1b9ca7219bf1906b134aae11d650d9698ea79cb6.tar.gz redmine-1b9ca7219bf1906b134aae11d650d9698ea79cb6.zip |
Removes dynamic :action in routes.
git-svn-id: http://svn.redmine.org/redmine/trunk@15634 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config')
-rw-r--r-- | config/routes.rb | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/config/routes.rb b/config/routes.rb index 06b500120..1e49a9dd5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -246,13 +246,13 @@ Rails.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/:action(/*path)', - :controller => 'repositories', - :format => false, - :constraints => { - :action => /(browse|show|entry|raw|annotate|diff)/, - :rev => /[a-z0-9\.\-_]+/ - } + %w(browse show entry raw annotate diff).each do |action| + get "projects/:id/repository/:repository_id/revisions/:rev/#{action}(/*path)", + :controller => 'repositories', + :action => action, + :format => false, + :constraints => {:rev => /[a-z0-9\.\-_]+/} + end get 'projects/:id/repository/statistics', :to => 'repositories#stats' get 'projects/:id/repository/graph', :to => 'repositories#graph' @@ -266,21 +266,28 @@ Rails.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/:action(/*path)', - :controller => 'repositories', - :format => false, - :constraints => { - :action => /(browse|show|entry|raw|annotate|diff)/, - :rev => /[a-z0-9\.\-_]+/ - } - get 'projects/:id/repository/:repository_id/:action(/*path)', - :controller => 'repositories', - :action => /(browse|show|entry|raw|changes|annotate|diff)/, - :format => false - get 'projects/:id/repository/:action(/*path)', - :controller => 'repositories', - :action => /(browse|show|entry|raw|changes|annotate|diff)/, - :format => false + %w(browse show entry raw annotate diff).each do |action| + get "projects/:id/repository/revisions/:rev/#{action}(/*path)", + :controller => 'repositories', + :action => action, + :format => false, + :constraints => {:rev => /[a-z0-9\.\-_]+/} + end + %w(browse entry raw changes annotate diff).each do |action| + get "projects/:id/repository/:repository_id/#{action}(/*path)", + :controller => 'repositories', + :action => action, + :format => false + end + %w(browse entry raw changes annotate diff).each do |action| + get "projects/:id/repository/#{action}(/*path)", + :controller => 'repositories', + :action => action, + :format => false + end + + get 'projects/:id/repository/:repository_id/show/*path', :to => 'repositories#show', :format => false + get 'projects/:id/repository/show/*path', :to => 'repositories#show', :format => false get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil get 'projects/:id/repository', :to => 'repositories#show', :path => nil |