Skip to content

elduglas/basic_pagination

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

basic_paginate

This week kata is about howto make a basic library or a class (it could be a concern) that permit to add pagination funcionality to a webapp view (Initially Ruby on Rails, later Sinatra, Cuba or whatever).

Remember wotk with TDD!

basic_paginate use

## perform a paginated query:
@posts = Post.paginate(:page => params[:page], :per_page => 30)

:per_page is a limit (number of rows to display)

## render page links in the view:
<%= basic_paginate @posts %>

And that's it! You're done. You just need to add some CSS styles to make those pagination links prettier

Happy paginating.

Some inspiration guides:

About

kata basic pagination

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 72.7%
  • HTML 19.4%
  • CSS 5.4%
  • JavaScript 1.9%
  • CoffeeScript 0.6%