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