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/10021270 to your computer and use it in GitHub Desktop.
Save iamvery/10021270 to your computer and use it in GitHub Desktop.
module Api
module V1
class ArticlesController < ApplicationController
def index
articles = [
{ id: 1, name: 'The Things' },
]
render json: articles
end
end
end
end
module Api
module V2
class ArticlesController < ApplicationController
def index
articles = {
articles: [
{ id: 1, title: 'The Things' },
],
}
render json: articles
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment