summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-01-18 14:19:31 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-01-22 09:59:10 +0200
commitf13edec8c7f568f32da9e516888ed229c8963051 (patch)
tree01e7790ee15eda5ab3789ed29b8c11cf4d4bf7a1 /config
parentce171674b60f5888aa3802e9f6b843762faabd3a (diff)
downloadgitlab-ce-f13edec8c7f568f32da9e516888ed229c8963051.tar.gz
Add ability to resolve project id into path
By visiting `projects/:id` you will be redirected to project page with path in it. projects/123 => foo/bar Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'config')
-rw-r--r--config/routes/project.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb
index d9afb4e7bc8..21793e7756a 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -2,6 +2,8 @@ resources :projects, only: [:index, :new, :create]
draw :git_http
+get '/projects/:id' => 'projects#resolve'
+
constraints(::Constraints::ProjectUrlConstrainer.new) do
# If the route has a wildcard segment, the segment has a regex constraint,
# the segment is potentially followed by _another_ wildcard segment, and