Topic: Making pagination works faster even with huge size of data

HI,

Im refactoring code since in the future it will handle large data now the problem is How can I make the pagination works  it may seem it works but it handle array that can be huge size. It will make big trouble with bigger data

Issue one
@rankings = Rank.search_word(params[:keyword]).by_table_area(params[:table_areas]).by_table_spot(params[:table_spots])
               
          unless params[:keyword].blank?
            @search_count = @rankings.count
          end 
          @rankings = @rankings.paginate(:per_page => PER_PAGE,:page => params[:page])



Issue Two

@ rankings = PlayerRankings . all.paginate ( : per_page => PER_PAGE , : page => params [ : page ])


All this is in controller..

Re: Making pagination works faster even with huge size of data

You can see 'kaminari' gem:
https://github.com/amatsuda/kaminari