Ruby On Rails Classroom image

Anil  Bist / 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
Anil  Bist

Skills    Ruby On Rails

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)