Skip to content

Instantly share code, notes, and snippets.

@netodevel
Created October 2, 2016 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netodevel/459985de99e3ab63f111ee1c508653c1 to your computer and use it in GitHub Desktop.
Save netodevel/459985de99e3ab63f111ee1c508653c1 to your computer and use it in GitHub Desktop.
class Api::V1::UserController < ApplicationController
def index
@api_v1_users = User.all
render json: @api_v1_users
end
end
###
class ApplicationController < ActionController::Base
protect_from_forgery with: :null_session
end
###
Rails.application.routes.draw do
namespace :api do
namespace :v1 do
resources :users
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment