Ruby Build a Rails API Coding the API Controller Actions and JSON Responses

Eric Collier
PRO
Eric Collier
Pro Student 3,821 Points

Build Show method for rails

class Api::MonkeysController < ApplicationController @monkey = Monkey.find(params[:id]) render JSON: @monkey end

Can you tell me what is wrong?

monkeys_controller.rb
class Api::MonkeysController < ApplicationController
  @monkey = Monkey.find(params[:id])
  render JSON: @monkey 
end