Including nested resources in JSONs output
Having trouble passing this last challenge on coding the API. Here's my code:
render json: @monkey.as_json(include::bananas)
Any ideas where I'm going wrong?
class MonkeysController < ApplicationController before_filter :find_monkey def show render json: @monkey.as_json(include::bananas) end private def find_monkey @monkey = Monkey.find(params[:id]) end end
Seth KrogerTreehouse Moderator 56,263 Points
Found the answer in a prior question on this challenge. For some reason the challenge checker needs a space between the two colons so if you put in "(include: :bananas)" it will pass.
Thanks a million Seth. Worked a treat!