@@ -42,7 +42,7 @@ def build(collection, options = {})
4242 unless collection . respond_to? ( :num_pages )
4343 raise ( StandardError , "Collection is not a paginated scope. Set collection.page(params[:page]).per(10) before calling :paginated_collection." )
4444 end
45-
45+
4646 div ( page_entries_info ( options ) . html_safe , :class => "pagination_information" )
4747 @contents = div ( :class => "paginated_collection_contents" )
4848 build_pagination_with_formats
@@ -70,7 +70,7 @@ def build_pagination_with_formats
7070 def build_pagination
7171 options = request . query_parameters . except ( :commit , :format )
7272 options [ :param_name ] = @param_name if @param_name
73-
73+
7474 text_node paginate ( collection , options . symbolize_keys )
7575 end
7676
@@ -107,9 +107,9 @@ def page_entries_info(options = {})
107107 else ; I18n . t ( 'active_admin.pagination.one_page' , :model => entries_name , :n => collection . size )
108108 end
109109 else
110- offset = collection . current_page * active_admin_application . default_per_page
110+ offset = collection . current_page * collection . size
111111 total = collection . total_count
112- I18n . t ( 'active_admin.pagination.multiple' , :model => entries_name , :from => ( offset - active_admin_application . default_per_page + 1 ) , :to => offset > total ? total : offset , :total => total )
112+ I18n . t ( 'active_admin.pagination.multiple' , :model => entries_name , :from => ( offset - collection . size + 1 ) , :to => offset > total ? total : offset , :total => total )
113113 end
114114 end
115115
0 commit comments