Basic comments visualisation

This commit is contained in:
riggraz
2019-09-17 17:04:19 +02:00
parent 476f720119
commit 0c0c6d4e30
9 changed files with 114 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ class CommentsController < ApplicationController
comments = Comment
.where(post_id: params[:post_id])
.left_outer_joins(:user)
.select('comments.id, comments.body, comments.updated_at, users.full_name as user_full_name')
.select('comments.id, comments.body, comments.parent_id, comments.updated_at, users.full_name as user_full_name')
.order(updated_at: :desc)
render json: comments