Display number of points found on the Points page

This commit is contained in:
Eugene Burmakin 2024-09-06 00:19:53 +02:00
parent 3592f46492
commit f81e119283
2 changed files with 5 additions and 0 deletions

View file

@ -17,6 +17,8 @@ class PointsController < ApplicationController
@start_at = Time.zone.at(start_at)
@end_at = Time.zone.at(end_at)
@points_number = @points.except(:limit, :offset).size
end
def bulk_destroy

View file

@ -43,6 +43,9 @@
<div class="flex justify-between my-5">
<%= f.submit "Delete Selected", class: "px-4 py-2 bg-red-500 text-white rounded-md", data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" } %>
<div class="flex justify-center">
<%= @points_number %> points found
</div>
<div class="flex justify-end">
<span class="mr-2">Order by:</span>
<%= link_to 'Newest', points_path(order_by: :desc), class: 'btn btn-xs btn-primary mx-1' %>