diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-02 00:29:55 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-06 23:51:19 +0300 |
commit | 9739f2c9450d87a629c0b14c2d5d7c7506380b99 (patch) | |
tree | 00c3b087d0e496a01830cfde3c20a1e5a6e5c72c /app/controllers/projects/variables_controller.rb | |
parent | c500e958fbdff0643865134b35f879b06b2347ac (diff) |
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
Diffstat (limited to 'app/controllers/projects/variables_controller.rb')
-rw-r--r-- | app/controllers/projects/variables_controller.rb | 5 |
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 |