Commit 9739f2c9 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Modified redirection logic in the variables cont.

Redirections now show a flash message wether the variable was created correctly or not using a flash message
parent c500e958
......@@ -25,10 +25,11 @@ class Projects::VariablesController < Projects::ApplicationController
@variable = Ci::Variable.new(project_params)
if @variable.valid? && @project.variables << @variable
redirect_to namespace_project_settings_ci_cd_path(project.namespace, project), notice: 'Variables were successfully updated.'
flash[:notice] = 'Variables were successfully updated.'
else
render action: "index"
flash[:alert] = @variable.errors.full_messages.join(',').html_safe
end
redirect_to namespace_project_settings_ci_cd_path(project.namespace, project)
end
def destroy
......
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