Add warning messages
This commit is contained in:
parent
5a2b43fcc6
commit
7329a0347f
1 changed files with 6 additions and 7 deletions
|
@ -60,21 +60,20 @@ class Projects::ClustersController < Projects::ApplicationController
|
||||||
.new(project, current_user, cluster_params)
|
.new(project, current_user, cluster_params)
|
||||||
.execute(cluster)
|
.execute(cluster)
|
||||||
|
|
||||||
respond_to do |format|
|
if cluster.valid?
|
||||||
format.html do
|
flash[:notice] = "Cluster updated"
|
||||||
|
redirect_to project_cluster_path(project, project.cluster)
|
||||||
|
else
|
||||||
render :show
|
render :show
|
||||||
end
|
end
|
||||||
|
|
||||||
format.json do
|
|
||||||
head :no_data
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
if cluster.destroy
|
if cluster.destroy
|
||||||
|
flash[:notice] = "Cluster removed"
|
||||||
redirect_to project_clusters_path(project), status: 302
|
redirect_to project_clusters_path(project), status: 302
|
||||||
else
|
else
|
||||||
|
flash[:notice] = "Cluster removed"
|
||||||
render :show
|
render :show
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue