|
46 | 46 | <%= @likes_count %> <%= Like.model_name.human(count: @likes_count) %>
|
47 | 47 | </div>
|
48 | 48 | <% if @liked %>
|
49 |
| - <%= button_to like_path(post_like_id: @liked), method: :delete, class: 'btn btn-sm', id: 'unlike' do %> |
50 |
| - <%= image_tag 'thumbs-up-solid', width: '20rem' %> |
51 |
| - <% end %> |
| 49 | + <%= button_to post_like_path(@post, @liked), method: :delete, class: 'btn btn-sm', id: 'unlike' do %> |
| 50 | + <%= image_tag 'thumbs-up-solid', width: '20rem' %> |
| 51 | + <% end %> |
52 | 52 | <% else %>
|
53 |
| - <%= button_to likes_path(post_id: @post), method: :post, class: 'btn btn-sm', id: 'like' do %> |
54 |
| - <%= image_tag 'thumbs-up-regular', width: '20rem' %> |
55 |
| - <% end %> |
| 53 | + <%= button_to post_likes_path(@post), method: :post, class: 'btn btn-sm', id: 'like' do %> |
| 54 | + <%= image_tag 'thumbs-up-regular', width: '20rem' %> |
| 55 | + <% end %> |
56 | 56 | <% end %>
|
57 | 57 | </div>
|
58 | 58 | </div>
|
|
87 | 87 | <div class="me-2">
|
88 | 88 | <% if user_signed_in? && comment.likes.where(user_id: current_user.id).any? %>
|
89 | 89 | <% like = comment.likes.find_by(user_id: current_user.id) %>
|
90 |
| - <%= button_to like_path(comment_like_id: like.id), method: :delete, class: 'btn btn-sm', id: 'unlike' do %> |
91 |
| - <%= image_tag 'thumbs-up-solid', width: '20rem', class: 'mb-4' %> |
| 90 | + <%= button_to comment_like_path(comment, like), method: :delete, class: 'btn btn-sm', id: 'unlike' do %> |
| 91 | + <%= image_tag 'thumbs-up-solid', width: '20rem', class: 'mb-4' %> |
92 | 92 | <% end %>
|
93 | 93 | <% else %>
|
94 |
| - <%= button_to likes_path(comment_id: comment.id), method: :post, class: 'btn btn-sm', id: 'like' do %> |
| 94 | + <%= button_to comment_likes_path(comment), method: :post, class: 'btn btn-sm', id: 'like' do %> |
95 | 95 | <%= image_tag 'thumbs-up-regular', width: '20rem', class: 'mb-2' %>
|
96 | 96 | <% end %>
|
97 | 97 | <% end %>
|
98 | 98 | </div>
|
99 | 99 | </div>
|
| 100 | + |
100 | 101 | <% if current_user != comment.user %>
|
101 | 102 | <div class="report-link-wrapper">
|
102 | 103 | <%= link_to t('reports.report_btn'), new_report_path(reportable: comment, reportable_type: comment.class), class: 'btn btn-secondary btn-sm' %>
|
|
0 commit comments