Skip to content

Instantly share code, notes, and snippets.

@iamvery
Last active August 29, 2015 13:58
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 iamvery/10328874 to your computer and use it in GitHub Desktop.
Save iamvery/10328874 to your computer and use it in GitHub Desktop.
# https://github.com/iamvery/rails-api-example/blob/b21a0a918c65892376ccbebaf96057051795afc0/app/controllers/v1/articles_controller.rb
module V1
class ArticlesController < ApplicationController
def index
articles = [
{ id: 123, name: 'The Things' },
]
respond_to do |format|
format.json do
render json: articles
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment