Ruby On Rails Classroom image

Neha  Jaggi / Professional / Web Technology

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


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.

Neha  Jaggi

Skills    Ruby On Rails

Qualifications :- High School - , College/University - Graphic Era Hill University, Dehradun, College/University - ,
Location :-Dehradun,Dehradun,UTTARAKHAND,India

Experienced Software Developer with a demonstrated history of working in the Information Technology and services industry. Skilled in Web Technologies (Ruby on Rails, PostgreSQL, php, Laravel and AJAX). 


  Students (0)