Skip to content

Instantly share code, notes, and snippets.

@smoovej
Created September 27, 2013 17:14
Show Gist options
  • Save smoovej/6731873 to your computer and use it in GitHub Desktop.
Save smoovej/6731873 to your computer and use it in GitHub Desktop.
def show
@article = Article.find(params[:id])
respond_to do |format|
format.html
format.json { render json: @article.as_json(only: [:id, :name, :content], include: [:author, {comments: {only:[:id, :name, :content]}}]) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment