If I do something like:
result = Appointment.find( :all, :include => :staff )
logger.debug { result.inspect }
then it only prints out t
:include
is an argument for to_json
, not find
. What you need to do in your controller is this:
def return_json
@appointment = Appointment.find(:all)
respond_to { |format|
format.json { render :json => @appointment.to_json(:include => :staff) }
}
end
You need to setup an association between Appointment and Staff for this to work.