Ruby On Rails Classroom image

prateek  darmwal / Professional / 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
prateek  darmwal

Skills    Ruby On Rails

Qualifications :- High School - S.K.M. Sn. Sec. School, Haldwani, College/University - Graphic Era Hill University, Bhimtal,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:- I like to explore new technologies. I have skills in ruby on rails, php5, cakephp, jquery, javascript, html/css, java, c & c++. I love coding
Explore
 

  Students (0)