From f13edec8c7f568f32da9e516888ed229c8963051 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 18 Jan 2019 14:19:31 +0200 Subject: 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 --- config/routes/project.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') 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 -- cgit v1.2.1