From 8264105ca365f9ccf518c93cd464063e2781f178 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Mon, 2 Mar 2015 19:41:25 +0000 Subject: [PATCH] Return meaningful error message for 422 --- app/controllers/api/asciicasts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/asciicasts_controller.rb b/app/controllers/api/asciicasts_controller.rb index cb12734..2ac601b 100644 --- a/app/controllers/api/asciicasts_controller.rb +++ b/app/controllers/api/asciicasts_controller.rb @@ -11,7 +11,7 @@ module Api location: asciicast rescue ActiveRecord::RecordInvalid => e - render nothing: true, status: 422 + render text: e.record.errors.messages, status: 422 end def show