summaryrefslogtreecommitdiff
path: root/config/routes/group.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-11-14 16:55:31 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-11-23 14:08:36 +0200
commit6683fdcfb0ae4ceb368b6f5f63dde0a10a4a3e1b (patch)
tree7530562c2e0702df3e74fc8ca8288e2e3f4ef0a2 /config/routes/group.rb
parentb1b5060dbad15975184ec20a1914c7c48fc804db (diff)
downloadgitlab-ce-6683fdcfb0ae4ceb368b6f5f63dde0a10a4a3e1b.tar.gz
Add nested groups support to the routingdz-allow-nested-group-routing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'config/routes/group.rb')
-rw-r--r--config/routes/group.rb20
1 files changed, 3 insertions, 17 deletions
diff --git a/config/routes/group.rb b/config/routes/group.rb
index a3a001178b4..9fe72990994 100644
--- a/config/routes/group.rb
+++ b/config/routes/group.rb
@@ -1,20 +1,6 @@
-require 'constraints/group_url_constrainer'
-
-constraints(GroupUrlConstrainer.new) do
- scope(path: ':id',
- as: :group,
- constraints: { id: Gitlab::Regex.namespace_route_regex },
- controller: :groups) do
- get '/', action: :show
- patch '/', action: :update
- put '/', action: :update
- delete '/', action: :destroy
- end
-end
-
resources :groups, only: [:index, :new, :create]
-scope(path: 'groups/:id',
+scope(path: 'groups/*id',
controller: :groups,
constraints: { id: Gitlab::Regex.namespace_route_regex }) do
get :edit, as: :edit_group
@@ -24,7 +10,7 @@ scope(path: 'groups/:id',
get :activity, as: :activity_group
end
-scope(path: 'groups/:group_id',
+scope(path: 'groups/*group_id',
module: :groups,
as: :group,
constraints: { group_id: Gitlab::Regex.namespace_route_regex }) do
@@ -42,4 +28,4 @@ scope(path: 'groups/:group_id',
end
# Must be last route in this file
-get 'groups/:id' => 'groups#show', as: :group_canonical, constraints: { id: Gitlab::Regex.namespace_route_regex }
+get 'groups/*id' => 'groups#show', as: :group_canonical, constraints: { id: Gitlab::Regex.namespace_route_regex }