diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 94941c9ff..6fc04de7e 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -10,7 +10,7 @@ class CropsController < ApplicationController @crops = Crop.includes(:scientific_names, {:plantings => :photos}).paginate(:page => params[:page]) respond_to do |format| - format.html + format.html format.json { render :json => @crops } format.rss do @crops = Crop.recent.includes(:scientific_names, :creator) @@ -62,7 +62,9 @@ class CropsController < ApplicationController respond_to do |format| format.html # show.html.haml - format.json { render json: @crop } + format.json do + render :json => @crop.to_json(:include => [:plantings, :seeds, :harvests]) + end end end