mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-06 07:59:53 -05:00
added plantings, seeds, and harvests to the crops JSON
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user