basic route to controller

master
Matt Huntington 8 years ago
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
# 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

Loading…
Cancel
Save