Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-01-18 15:19:31 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-01-22 10:59:10 +0300
commitf13edec8c7f568f32da9e516888ed229c8963051 (patch)
tree01e7790ee15eda5ab3789ed29b8c11cf4d4bf7a1 /config
parentce171674b60f5888aa3802e9f6b843762faabd3a (diff)
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