summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-10-19 14:42:30 +1300
committerThong Kuah <tkuah@gitlab.com>2018-11-01 19:36:58 +1300
commit88800abcd8741b07114c2850e00b74fbecfbf90e (patch)
tree06dcb6a6a8036164eb73df0da2cc13150357dda7 /config
parent5b3c096c9e0c9e8e7e1cb35c1b9e347995b948f5 (diff)
downloadgitlab-ce-88800abcd8741b07114c2850e00b74fbecfbf90e.tar.gz
Abstract out project out of ClustersController
To the extent possible swap out `project` with `clusterable` - Abstract paths for showing cluster or clusters. This will allow us to swap in alternative paths for group level cluster - Push :project_id and :namespace_id params from the URL to the POST body. - Create a nice helper for to generate links for the destroy action For some reason, spec :project_id and :namespace_id param are not going through `to_param` for a JSON format. Manually call `to_param` to fix specs. - Move :layout to BaseController
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb30
1 files changed, 16 insertions, 14 deletions
diff --git a/config/routes.rb b/config/routes.rb
index cfb81cabfe4..bf5023eeec2 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -74,6 +74,21 @@ Rails.application.routes.draw do
resources :issues, module: :boards, only: [:index, :update]
end
+ resources :clusters, only: [:update, :destroy] do
+ collection do
+ post :create_user
+ post :create_gcp
+ end
+
+ member do
+ scope :applications do
+ post '/:application', to: 'clusters/applications#create', as: :install_applications
+ end
+
+ get :status, format: :json
+ end
+ end
+
# UserCallouts
resources :user_callouts, only: [:create]
@@ -85,20 +100,7 @@ Rails.application.routes.draw do
end
concern :clusterable do
- resources :clusters, except: [:edit, :create], controller: '/clusters' do
- collection do
- post :create_gcp
- post :create_user
- end
-
- member do
- get :status, format: :json
-
- scope :applications do
- post '/:application', to: '/clusters/applications#create', as: :install_applications
- end
- end
- end
+ resources :clusters, only: [:index, :new, :show], controller: '/clusters'
end
draw :api