Retrospring/app/controllers/comment_controller.rb

11 lines
269 B
Ruby
Raw Normal View History

2023-03-11 10:48:04 -08:00
# frozen_string_literal: true
class CommentController < ApplicationController
def index
answer = Answer.find(params[:id])
comments = Comment.where(answer:).includes([{user: :profile}, :smiles])
render "index", locals: { a: answer, comments: }
end
end