From 71f51db3c2515addaf8b280667555427d64796be Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Tue, 30 Jan 2024 17:34:11 +0000 Subject: [PATCH] fix: fixes error messages in web ui --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 817938ed..193a24b7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -90,7 +90,7 @@ def redirect_to_with_json(url, flash_messages = {}) def render_form_errors(action_name, object) respond_to do |wants| wants.html { render action_name } - wants.json { render json: { form_errors: object.errors.full_messages }, status: :unprocessable_entity } + wants.json { render json: { form_errors: object.errors.map(&:full_message) }, status: :unprocessable_entity } end end