From 6102f0629b3697d21f6a3dcab5846d6b2252e4ab Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 4 Feb 2024 10:25:41 +1030 Subject: [PATCH] Revert 140fe7a (#3612) * Revert 140fe7a * Split rendering behaviour --- app/controllers/crops_controller.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 1332967a1..5f4f10eda 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -63,8 +63,16 @@ class CropsController < ApplicationController @crops = CropSearchService.search(@term, page: params[:page], per_page: Crop.per_page, - current_member:).to_a - respond_with @crops + current_member:) + + respond_to do |format| + format.html do + render + end + format.json do + render json: @crops.to_a + end + end end def show