diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-05-11 22:04:25 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-05-11 22:04:25 +0000 |
commit | f2251273b9868c94ac2a6f3f2e231282a4687043 (patch) | |
tree | 1b4e35b44a960db5e2aa84dd0df0f4c87383f5aa /config | |
parent | 44f6e34bb52acd0784b15913e00a9de7486870cb (diff) | |
parent | a22d559d27eda2661039ed856dc636171f4b7362 (diff) | |
download | gitlab-ce-f2251273b9868c94ac2a6f3f2e231282a4687043.tar.gz |
Merge branch 'issue_15572_snippets_tab_under_user_profile' into 'master'
Add snippet tab under user profile
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/15572
See merge request !4001
Diffstat (limited to 'config')
-rw-r--r-- | config/routes.rb | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/config/routes.rb b/config/routes.rb index dafecc94648..881de37f10e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -91,7 +91,8 @@ Rails.application.routes.draw do end end - get '/s/:username' => 'snippets#index', as: :user_snippets, constraints: { username: /.*/ } + get '/s/:username', to: redirect('/u/%{username}/snippets'), + constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } # # Invites @@ -342,23 +343,18 @@ Rails.application.routes.draw do end end - get 'u/:username/calendar' => 'users#calendar', as: :user_calendar, - constraints: { username: /.*/ } - - get 'u/:username/calendar_activities' => 'users#calendar_activities', as: :user_calendar_activities, - constraints: { username: /.*/ } - - get 'u/:username/groups' => 'users#groups', as: :user_groups, - constraints: { username: /.*/ } - - get 'u/:username/projects' => 'users#projects', as: :user_projects, - constraints: { username: /.*/ } - - get 'u/:username/contributed' => 'users#contributed', as: :user_contributed_projects, - constraints: { username: /.*/ } - - get '/u/:username' => 'users#show', as: :user, - constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } + scope(path: 'u/:username', + as: :user, + constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, + controller: :users) do + get :calendar + get :calendar_activities + get :groups + get :projects + get :contributed, as: :contributed_projects + get :snippets + get '/', action: :show + end # # Dashboard Area |