parent
c5a5b414a2
commit
c67b74bc23
@ -0,0 +1,7 @@
|
|||||||
|
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 }
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,3 +1,5 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
||||||
|
get '/fruits', to: 'fruits#index'
|
||||||
|
# get('/fruits', { :to => 'fruits#index' })
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in new issue