Added a flash message to the creation of triggers

This commit is contained in:
Jose Ivan Vargas 2017-01-27 11:48:58 -06:00
parent 6004519546
commit 2824c1d8d7

View file

@ -8,15 +8,16 @@ class Projects::TriggersController < Projects::ApplicationController
@trigger.save
if @trigger.valid?
redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project)
flash[:notice] = "Trigger has been created successfully"
else
@triggers = project.triggers.select(&:persisted?)
render :index
end
redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project)
end
def destroy
trigger.destroy
flash[:alert] = "Trigger removed"
redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project)
end