Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

33 Commits

Repository files navigation

A really simple pagination library, heavily based on the agnostic branch of will_paginate.

Leaf supports pagination for collections responding to total_pages, per_page, previous_page and total_entries in Sinatra views out of the box.

It currently supports two renderers: Leaf::ViewHelpers::LinkRenderer and Leaf::ViewHelpers::ListRenderer

geminstallleaf
require'rubygems'require'sinatra'require'leaf'includeLeaf::ViewHelpers::Base# Needed to paginate any array# you’ll probably use something else.require'leaf/array'get'/'dopage = (params[:page]) ?params[:page] :1array = ('a'..'z').to_ahaml:index, :locals=> { :collection=>array.paginate({
:page=>page, :per_page=>5
}) }
end
__END__

Leaf is based on will_paginate which was originally written by PJ Hyett, who later handed over development to Mislav Marohnić. (The library was completely rewritten since then.)

About

A simple pagination library based on the agnostic branch of will_paginate

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages