Files
fizzy/app/views/cards/comments/_comment.json.jbuilder
T
Kevin McConnell 4e9773f9f5 Correct card URL in comment JSON output
When rendering details of a comment, we were using the card's `id` as
the param for the URL. But card routes use the card's number, not ID.
2026-02-17 17:11:39 +00:00

22 lines
508 B
Ruby

json.cache! comment do
json.(comment, :id)
json.created_at comment.created_at.utc
json.updated_at comment.updated_at.utc
json.body do
json.plain_text comment.body.to_plain_text
json.html comment.body.to_s
end
json.creator comment.creator, partial: "users/user", as: :user
json.card do
json.id comment.card_id
json.url card_url(comment.card)
end
json.reactions_url card_comment_reactions_url(comment.card, comment)
json.url card_comment_url(comment.card, comment)
end