From a21ae014efd9b3d705eb2f8ed985bdfd6b5588f3 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 12 Oct 2023 18:08:43 -0700 Subject: [PATCH] Fix crash when rendering modeling errors Oh right, you can't return text from a format.json, but text can be json! --- app/controllers/pets_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/pets_controller.rb b/app/controllers/pets_controller.rb index eb552793..a4456839 100644 --- a/app/controllers/pets_controller.rb +++ b/app/controllers/pets_controller.rb @@ -86,7 +86,7 @@ class PetsController < ApplicationController end format.json do - render :text => options[:long_message], :status => options[:status] + render :json => options[:long_message], :status => options[:status] end end end