app/views/comments/_comment.html.haml
- if comment.persisted?
= turbo_frame_tag comment, class: "comments" do
- if correct_user?(comment.created_by)
.links-end
= link_to [:edit, comment.commentable, comment], title: 'Edit' do
%i.fa-solid.fa-pen-to-square
Edit
= link_to [comment.commentable, comment],
data: { turbo_method: :delete, turbo_confirm: 'Are you sure.' },
class: 'delete-link', title: 'Delete' do
%i.fa-solid.fa-trash
= render 'users/post_user', user: comment.created_by
.content= simple_format(comment.body)
.timestamp
Posted #{time_ago_in_words(comment.created_at)} ago
.d-flex.justify-content-between.align-items-center
= render "likes/count", likeable: comment
= render "likes/form", likeable: comment