From 7f8bb9be53c5bc658bd6ec8cc5f2086c3b376979 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Mon, 29 Aug 2016 13:59:51 +0200 Subject: [PATCH] fixes hound again --- app/controllers/samples_controller.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/samples_controller.rb b/app/controllers/samples_controller.rb index 045f87011..8e69cb746 100644 --- a/app/controllers/samples_controller.rb +++ b/app/controllers/samples_controller.rb @@ -81,13 +81,14 @@ class SamplesController < ApplicationController errors.delete_if { |k, v| v.blank? } if errors.empty? format.json - render 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 } @@ -236,13 +237,14 @@ class SamplesController < ApplicationController scf_to_delete.map(&:destroy) format.json - render 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 }