mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 14:09:53 +01:00
Appease the dog overlords (mostly)
This commit is contained in:
parent
adf294e6cb
commit
9563a586c2
3 changed files with 4 additions and 4 deletions
|
@ -14,12 +14,12 @@ class Ajax::CommentController < AjaxController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
comments = Comment.where(answer:).includes([{user: :profile}, :smiles])
|
comments = Comment.where(answer:).includes([{ user: :profile }, :smiles])
|
||||||
|
|
||||||
@response[:status] = :okay
|
@response[:status] = :okay
|
||||||
@response[:message] = t(".success")
|
@response[:message] = t(".success")
|
||||||
@response[:success] = true
|
@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
|
@response[:count] = answer.comment_count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class CommentController < ApplicationController
|
class CommentController < ApplicationController
|
||||||
def index
|
def index
|
||||||
answer = Answer.find(params[:id])
|
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 }
|
render "index", locals: { a: answer }
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ require "rails_helper"
|
||||||
describe "answerbox/_comments.html.haml", type: :view do
|
describe "answerbox/_comments.html.haml", type: :view do
|
||||||
subject(:rendered) do
|
subject(:rendered) do
|
||||||
render partial: "answerbox/comments", locals: {
|
render partial: "answerbox/comments", locals: {
|
||||||
comments:, a:
|
comments:, a:,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue