summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorLong Nguyen <long.polyglot@gmail.com>2016-05-08 20:48:07 +0700
committerLong Nguyen <long.polyglot@gmail.com>2016-05-08 20:48:07 +0700
commit29089352e388882a799daff7623fc7213f60e1c9 (patch)
tree47e88f0101fb89913b9d31b72fa79de9a6f2ee17 /config
parent3d4627047ae7e9947fc3924c2615fb2865f2383b (diff)
downloadgitlab-ce-29089352e388882a799daff7623fc7213f60e1c9.tar.gz
Routing refactoring
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 299b0dd1acf..594bab204fd 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -343,19 +343,16 @@ Rails.application.routes.draw do
end
end
- resources(:users,
- path: 'u',
- param: :username,
- constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ },
- only: :show) do
- member do
- get :calendar, as: :calendar
- get :calendar_activities, as: :calendar_activities
- get :groups, as: :groups
- get :projects, as: :projects
- get :contributed, as: :contributed_projects
- get :snippets, as: :snippets
- end
+ scope(path: 'u/:username',
+ constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ },
+ controller: :users) do
+ get :calendar, action: :calendar, as: :user_calendar
+ get :calendar_activities, action: :calendar_activities, as: :user_calendar_activities
+ get :groups, action: :groups, as: :user_groups
+ get :projects, action: :projects, as: :user_projects
+ get :contributed, action: :contributed, as: :user_contributed_projects
+ get :snippets, action: :snippets, as: :user_snippets
+ get '/', action: :show, as: :user
end
#