0

I am working on rails 2 application I need to work with the 8000 records and show them in table.

I need to do limit to the loading record.

Like from 8000 records I want to show 10 records then only 10 records are display then click on next button next 10 record should be shown.

LIke pagination but could not do pagination because it load all 8000 records at a time.and it takes too much of time.

I think offset and limit help me but I could not know how to use it.

My basic query is
@users = @client.users

I also try datatable server side but it is not working.

Please help me.
THanks

urjit on rails
  • 1,763
  • 4
  • 19
  • 36

1 Answers1

0

Use Will_paginate plugin of rails for pagination.

check documentation on https://github.com/mislav/will_paginate/blob/8888651be8d6656bdf2378731d91a8badbaa2556/README.rdoc

Sonal S.
  • 1,444
  • 1
  • 15
  • 31
  • Thanks for your reply but I use this gem it load all the 8000 record at once I want to load for ex. 10 record and on clicking the next or page 2 load the other set of records so it take less time. I hope you understand. – urjit on rails Jan 07 '13 at 05:06
  • For this, U have to specify how many records u want to display per page on ur view. :per_page => 50 – Sonal S. Jan 07 '13 at 06:58