From 60b0d69a722991b9aa968af2c26a13c835c3f493 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Mon, 29 Aug 2016 13:56:05 +0200 Subject: [PATCH] fixes hound --- app/controllers/samples_controller.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/controllers/samples_controller.rb b/app/controllers/samples_controller.rb index 21e8cae0f..045f87011 100644 --- a/app/controllers/samples_controller.rb +++ b/app/controllers/samples_controller.rb @@ -80,17 +80,15 @@ class SamplesController < ApplicationController errors.delete_if { |k, v| v.blank? } if errors.empty? - format.json { - render json: { + format.json + render json: id: sample.id, flash: t( 'samples.create.success_flash', sample: sample.name, organization: @organization.name - ) - }, + ), status: :ok - } else format.json { render json: errors, status: :bad_request } end @@ -237,17 +235,15 @@ class SamplesController < ApplicationController # Now we can destroy empty scfs scf_to_delete.map(&:destroy) - format.json { - render json: { + format.json + render json: id: sample.id, flash: t( 'samples.update.success_flash', sample: sample.name, organization: @organization.name - ) - }, + ), status: :ok - } else format.json { render json: errors, status: :bad_request } end