Pagination for Padrino framework:
- brutal
- classic
- digg
- extended
- bootstrap_classic
- punbb (default)
Add this line to your application's Gemfile:
gem 'padrino-pagination'
And then execute:
$ bundle
Or install it yourself as:
$ gem install padrino-pagination
In your template:
= paginate(:posts, :index, 7890, :page => 1)
or with options:
= paginate(:articles, :list, total, :page => page, :per_page => 12, :template => :brutal)
The helper uses the link style of url(:controller, :action, :current_page => page)
so that way it can be flexible for your controller schema.
╔══════════════╦════════════════════════════════╗
║ page ║ current page (default 1) ║
╠══════════════╬════════════════════════════════╣
║ per_page ║ items per page (default 20) ║
╠══════════════╬════════════════════════════════╣
║ template ║ used template (see list above) ║
╚══════════════╩════════════════════════════════╝
- The pages are enclosed by a div with “pagination” class
- Prevev/next links has “prev_next” class
- First/last links has “first_last” class
- The numbers are enclosed by a div with “pages” clas
- Page links are, well, links inside that “pages” div
- And the current page is a span with “current” class
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Padrino
- Sinatra
- templates are based on Kohanaphp 2.3.4 pagination templates
Copyright (c) 2010-2013 Vladyslav Sumskyi, released under the WTFPL license