Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-10-04 14:51:12 +0300
committerFilipa Lacerda <filipa@gitlab.com>2017-10-04 14:51:12 +0300
commit7329a0347f6093a15ffb0cf8f6a9ddc7f0495cb6 (patch)
treea3e19eddc8857a423bfd0faaea061eb59522e578 /app/controllers
parent5a2b43fcc6490847fae39a1dce38ce13d5860da3 (diff)
Add warning messages
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/clusters_controller.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb
index 5dbabaf7813..46118184993 100644
--- a/app/controllers/projects/clusters_controller.rb
+++ b/app/controllers/projects/clusters_controller.rb
@@ -60,21 +60,20 @@ class Projects::ClustersController < Projects::ApplicationController
.new(project, current_user, cluster_params)
.execute(cluster)
- respond_to do |format|
- format.html do
+ if cluster.valid?
+ flash[:notice] = "Cluster updated"
+ redirect_to project_cluster_path(project, project.cluster)
+ else
render :show
end
-
- format.json do
- head :no_data
- end
- end
end
def destroy
if cluster.destroy
+ flash[:notice] = "Cluster removed"
redirect_to project_clusters_path(project), status: 302
else
+ flash[:notice] = "Cluster removed"
render :show
end
end