From a8a933d73a5abefe80d2cd1e72659b850da46a5c Mon Sep 17 00:00:00 2001 From: Eduardo Date: Thu, 18 Jun 2020 20:35:37 -0300 Subject: [PATCH] change from render json to render plain due to template missing issue --- app/controllers/api/order_cycles_controller.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/order_cycles_controller.rb b/app/controllers/api/order_cycles_controller.rb index 63afec28ca..ddc7b15fa5 100644 --- a/app/controllers/api/order_cycles_controller.rb +++ b/app/controllers/api/order_cycles_controller.rb @@ -20,7 +20,7 @@ module Api search_params ).products_json - render json: products + render plain: products, content_type: "application/json" rescue ProductsRenderer::NoProducts render_no_products end @@ -31,13 +31,15 @@ module Api where(spree_products: { id: distributed_products }). select('DISTINCT spree_taxons.*') - render json: ActiveModel::ArraySerializer.new(taxons, each_serializer: Api::TaxonSerializer) + render plain: ActiveModel::ArraySerializer.new( + taxons, each_serializer: Api::TaxonSerializer + ).to_json, content_type: "application/json" end def properties - render json: ActiveModel::ArraySerializer.new( + render plain: ActiveModel::ArraySerializer.new( product_properties | producer_properties, each_serializer: Api::PropertySerializer - ) + ).to_json, content_type: "application/json" end private