Ruby Build a Rails API Coding the API Returning JSON

I'm getting error despite of addding render json: @monkey.as_json(include::bananas)

for the following question i'm adding above code as an answer but its giving an error

Let's make sure when we call monkey, we can see all the bananas she has. Change the code below to use as_json to include bananas in the JSON render. Hint: We're only including one thing, so this does not need an array!

1 Answer

Got it . @monkey.as_json(include: :bananas) is the correct code .there's a space between "::"