diff --git a/app/controllers/ajax/comment_controller.rb b/app/controllers/ajax/comment_controller.rb index c2ef3341..c7264464 100644 --- a/app/controllers/ajax/comment_controller.rb +++ b/app/controllers/ajax/comment_controller.rb @@ -14,12 +14,12 @@ class Ajax::CommentController < AjaxController return end - comments = Comment.where(answer:).includes([{user: :profile}, :smiles]) + comments = Comment.where(answer:).includes([{ user: :profile }, :smiles]) @response[:status] = :okay @response[:message] = t(".success") @response[:success] = true - @response[:render] = render_to_string(partial: 'answerbox/comments', locals: { a: answer, comments: }) + @response[:render] = render_to_string(partial: "answerbox/comments", locals: { a: answer, comments: }) @response[:count] = answer.comment_count end diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index 0b61f2eb..d8b9ea6f 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -3,7 +3,7 @@ class CommentController < ApplicationController def index answer = Answer.find(params[:id]) - @comments = Comment.where(answer:).includes([{user: :profile}, :smiles]) + @comments = Comment.where(answer:).includes([{ user: :profile }, :smiles]) render "index", locals: { a: answer } end diff --git a/spec/views/answerbox/_comments.html.haml_spec.rb b/spec/views/answerbox/_comments.html.haml_spec.rb index 90090069..3af138d6 100644 --- a/spec/views/answerbox/_comments.html.haml_spec.rb +++ b/spec/views/answerbox/_comments.html.haml_spec.rb @@ -5,7 +5,7 @@ require "rails_helper" describe "answerbox/_comments.html.haml", type: :view do subject(:rendered) do render partial: "answerbox/comments", locals: { - comments:, a: + comments:, a:, } end