Commit 2824c1d8 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Added a flash message to the creation of triggers

parent 60045195
...@@ -8,15 +8,16 @@ class Projects::TriggersController < Projects::ApplicationController ...@@ -8,15 +8,16 @@ class Projects::TriggersController < Projects::ApplicationController
@trigger.save @trigger.save
if @trigger.valid? if @trigger.valid?
redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project) flash[:notice] = "Trigger has been created successfully"
else else
@triggers = project.triggers.select(&:persisted?) @triggers = project.triggers.select(&:persisted?)
render :index
end end
redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project)
end end
def destroy def destroy
trigger.destroy trigger.destroy
flash[:alert] = "Trigger removed"
redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project) redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment