Created
          June 24, 2015 21:51 
        
      - 
      
- 
        Save jraczak/427675310f71890f36fd 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
    
  
  
    
  | # controllers/api/venues_controller.rb | |
| module API | |
| class VenuesController < ApplicationController | |
| respond_to :json | |
| def show | |
| @venue = Venue.find(params[:id]) | |
| render json: @venue | |
| #respond_to do |format| | |
| # format.json { render :json => venue } | |
| #end | |
| end | |
| end | |
| end | |
| #routes.rb | |
| ... | |
| #API Routes | |
| namespace :api, path: '/', constraints: { subdomain: 'api' } do | |
| resources :venues, only: [ :index, :show ] | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment