Updated the #create action to render the show view in case of a form error

This commit is contained in:
Jose Ivan Vargas 2017-02-06 13:05:20 -06:00
parent 44bb70c8c9
commit b5df3bffd7
1 changed files with 2 additions and 2 deletions

View File

@ -26,10 +26,10 @@ class Projects::VariablesController < Projects::ApplicationController
if @variable.valid? && @project.variables << @variable
flash[:notice] = 'Variables were successfully updated.'
redirect_to namespace_project_settings_ci_cd_path(project.namespace, project)
else
flash[:alert] = @variable.errors.full_messages.join(',').html_safe
render "show"
end
redirect_to namespace_project_settings_ci_cd_path(project.namespace, project)
end
def destroy