diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-02-01 23:38:41 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-05 20:58:20 +0300 |
commit | c95c3ffc9e4f1992929899bfc21440b621cc8daf (patch) | |
tree | a40f32e73f159720b5d8d0906a7883ee281aede7 /app/controllers/projects/variables_controller.rb | |
parent | e2c8a2231bcc00e5993411e4ad6c0c0db7e1a297 (diff) |
Switch emphasis from controller format to update
Diffstat (limited to 'app/controllers/projects/variables_controller.rb')
-rw-r--r-- | app/controllers/projects/variables_controller.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb index 18225218a1b..329e1cdfef0 100644 --- a/app/controllers/projects/variables_controller.rb +++ b/app/controllers/projects/variables_controller.rb @@ -10,13 +10,13 @@ class Projects::VariablesController < Projects::ApplicationController end def update - respond_to do |format| - format.json do - if @project.update(variables_params) - return render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) } - end - - render status: :bad_request, json: @project.errors.full_messages + if @project.update(variables_params) + respond_to do |format| + format.json { return render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) } } + end + else + respond_to do |format| + format.json { render status: :bad_request, json: @project.errors.full_messages } end end end |