Retrospring/app/views/reactions/_destroy.html.haml

22 lines
1.1 KiB
Plaintext

- if type == "Answer"
= button_to destroy_reactions_path(id: target.id, username: target.user.screen_name),
method: :delete,
form: { class: "d-inline-block",
id: "reaction-#{type}-#{target.id}",
data: { controller: :reaction, action: "turbo:submit-start->reaction#disable turbo:submit-end->reaction#enable" } },
class: "btn btn-link answerbox__action unsmile",
data: { reaction_target: :button } do
%i.fa.fa-smile-o
%span= target.smile_count
- if type == "Comment"
= button_to destroy_comment_reactions_path(id: target.id, username: target.user.screen_name),
method: :delete,
form: { class: "d-inline-block",
id: "reaction-#{type}-#{target.id}",
data: { controller: :reaction, action: "turbo:submit-start->reaction#disable turbo:submit-end->reaction#enable" } },
class: "btn btn-link answerbox__action unsmile",
data: { reaction_target: :button } do
%i.fa.fa-smile-o
%span= target.smile_count