Created
June 23, 2015 21:44
-
-
Save jraczak/72d75e42d28f02a66945 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# routes.rb | |
... | |
#API Routes | |
namespace :api, path: '/', constraints: { subdomain: 'api' } do | |
resources :venues, only: [ :index, :show ] | |
end | |
# /controllers/api/venues_controller.rb | |
module API | |
class VenuesController < ApplicationController | |
def show | |
venue = Venue.find(params[:id]) | |
# render json: venue | |
respond_to do |format| | |
format.json { render :json => venue } | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment