array of fruit objects

master
Matt Huntington 8 years ago
parent c67b74bc23
commit 1313ebf969

@ -2,6 +2,10 @@ class FruitsController < ApplicationController
def index
# render({ :json => { :message => 'hi', :status => 200 } })
# render json: message: 'hi', status: 200 # doesn't work because nested objects are unguessable
render json: { message: 'hi', status: 200 }
render json: [
{ name: 'apple', color: 'red', readyToEat: true },
{ name: 'banana', color: 'yellow', readyToEat: false },
{ name: 'pineapple', color: 'yelow', readyToEat: true }
]
end
end

Loading…
Cancel
Save