Add warning messages

This commit is contained in:
Filipa Lacerda 2017-10-04 12:51:12 +01:00
parent 5a2b43fcc6
commit 7329a0347f
No known key found for this signature in database
GPG key ID: 9CA3FDE4D1E2F1C8

View file

@ -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