Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  |1 | 2 | 3 | 4 | 5|Last
Lessons:-Pagination

Pagination

Our original user doesn’t suffer from loneliness any more, but now we have the opposite problem: Our user has too many companions, and they all appear on the same page. Right now there are a hundred, which is already a reasonably large number, and on a real site it could be thousands. The solution is to paginate the users, so that (for example) only 30 show up on a page at any one time.

There areseveral pagination methods in Rails; we’ll use one of thesimplest and most robust, called will paginate. To useit, we need to include both the will paginate gem and bootstrap-will paginate, which configures will paginate to use Bootstrap’s pagination styles. The updated Gemfile appears in Listing 9.31.

 

             Figure 9.9 The user index page /users with 100 sample users.

 

 

Then run bundle install:

$  bundle  install

 

You should also restart the web server to insure that the new gems are loaded properly.

 
 
 
image
Pooja   Negi

Skills    Ruby On Rails

Qualifications :- High School - SSN high school, College/University - HNBGU, College/University - SRHU,
Location :-Ranipokhari,Rishikesh,Uttarakhand,India
Description:- Student
Explore
 

  Students (0)