Skip to content

Instantly share code, notes, and snippets.

@hpjaj
Created November 14, 2018 15:26
Show Gist options
  • Save hpjaj/4f8bec20774337a96dade75dfd8ca720 to your computer and use it in GitHub Desktop.
Save hpjaj/4f8bec20774337a96dade75dfd8ca720 to your computer and use it in GitHub Desktop.
# app/controllers/api/posts_controller.rb
module API
class PostsController < ApplicationController
def index
posts = ['Post 1', 'Post 2']
render json: { posts: posts }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment