miniature-optician-85831
10/16/2023, 7:40 PMlemon-wall-20836
10/16/2023, 7:41 PMlemon-wall-20836
10/16/2023, 7:43 PMlemon-wall-20836
10/16/2023, 7:43 PMpagy
is used for pagination in Avogorgeous-army-21193
10/16/2023, 7:46 PMlemon-wall-20836
10/16/2023, 7:46 PMlemon-wall-20836
10/16/2023, 7:48 PMresource_table_component
(both .rb and .erb) files inside your app and remove the bit that says pagy.count
https://github.com/avo-hq/avo/blob/main/app/components/avo/index/resource_table_component.rb
https://github.com/avo-hq/avo/blob/main/app/components/avo/index/resource_table_component.erblemon-wall-20836
10/16/2023, 7:48 PMloud-jewelry-99127
10/17/2023, 8:20 AM<% if @pagy.count > 0 %>
to <% if !index_params.dig(:pagy_count_off) && @pagy.count > 0 %>
Now whenever i want to disable some resource pagination i go to that resource's controller and implement this method
ruby
def set_index_params
super
@index_params.merge! pagy_count_off: true
end
loud-jewelry-99127
10/17/2023, 8:31 AMresource_table_component
gorgeous-army-21193
10/23/2023, 9:17 PMgorgeous-army-21193
10/23/2023, 9:19 PMbefore_action :set_pagy, only: :index
def set_pagy
@pagy, @records = pagy_countless(User.all, countless_minimal: true)
end
gorgeous-army-21193
10/23/2023, 10:18 PMloud-jewelry-99127
10/24/2023, 4:13 AM.rb
too when tried itloud-jewelry-99127
10/24/2023, 4:15 AM.rb
is actually required too in order to override the componentloud-jewelry-99127
10/24/2023, 4:17 AMgorgeous-army-21193
10/24/2023, 8:31 PM@pagy, @models = pagy(@query, items: @index_params[:per_page], link_extra: "data-turbo-frame=\"#{params[:turbo_frame]}\"", size: [1, 2, 2, 1], params: extra_pagy_params)
lemon-wall-20836
10/24/2023, 8:35 PMlemon-wall-20836
10/24/2023, 8:36 PMlemon-wall-20836
10/24/2023, 8:36 PMlemon-wall-20836
10/24/2023, 8:36 PMlemon-wall-20836
10/24/2023, 8:49 PMlemon-wall-20836
10/24/2023, 8:50 PMloud-jewelry-99127
10/25/2023, 9:22 AMlemon-wall-20836
10/25/2023, 10:05 AMloud-jewelry-99127
10/25/2023, 10:32 AMlemon-wall-20836
10/25/2023, 10:33 AM