comments.rb 312 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 module API module V1 class Comments < Grape::API resource :articles do get ":id/comments" do Article.find(params[:id]).comments end get ":id/comments/:comment_id" do Article.find(params[:id]).comments.find(params[:comment_id]) end end end end end