mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 03:07:52 +01:00
12 lines
293 B
Ruby
12 lines
293 B
Ruby
class CommentsController < ApplicationController
|
|
def index
|
|
comments = Comment
|
|
.where(post_id: params[:post_id])
|
|
.left_outer_joins(:user)
|
|
.select('comments.body, comments.updated_at, users.full_name')
|
|
.order(updated_at: :desc)
|
|
|
|
render json: comments
|
|
end
|
|
end
|