summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-02-01 15:29:55 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2017-02-06 14:51:19 -0600
commit9739f2c9450d87a629c0b14c2d5d7c7506380b99 (patch)
tree00c3b087d0e496a01830cfde3c20a1e5a6e5c72c
parentc500e958fbdff0643865134b35f879b06b2347ac (diff)
downloadgitlab-ce-9739f2c9450d87a629c0b14c2d5d7c7506380b99.tar.gz
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
-rw-r--r--app/controllers/projects/variables_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
index 574f6549645..06429f56116 100644
--- a/app/controllers/projects/variables_controller.rb
+++ b/app/controllers/projects/variables_controller.rb
@@ -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