From a9f38962bc48fab49543deb897a7e4a6a28c75d4 Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 28 Jun 2017 11:17:50 +0200 Subject: [PATCH] Fixes error message [fixes SCI-1129] --- app/assets/javascripts/results/result_assets.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/results/result_assets.js b/app/assets/javascripts/results/result_assets.js index ebf838234..4cd7b846c 100644 --- a/app/assets/javascripts/results/result_assets.js +++ b/app/assets/javascripts/results/result_assets.js @@ -76,7 +76,14 @@ Comments.initialize(); initNewResultAsset(); }).on('ajax:error', function(e, xhr) { - $form.renderFormErrors('result', xhr.responseJSON, true, e); + var errors = xhr.responseJSON.errors; + var formInput = $form.find('#result_asset_attributes_file'); + $('[data-status="error"]').remove(); + $.each(errors, function(key, value) { + var message = ''; + message += value + ''; + formInput.after(message); + }) animateSpinner(null, false); }); }