Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pagination

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pagination

  • 0.3.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Pagination: Trying to make the pagination world a better place

Why another pagination library?

Because I constantly work with designers, who prefer to have their own pagination markup customized to their heart's content. Current problems I have:

  1. It is very hard for me to change the markup with the current libraries out there.
  2. No Ohm / Redis support available (as far as I know).
  3. NIH?

Name the Niche:

This is currently streamlined for use with:

  1. Sinatra
  2. Ohm
  3. HAML

How to use?

require 'rubygems'
require 'sinatra'
require 'pagination'

helpers Pagination::Helpers

get '/items' do
  # Let's say current_user returns a User model with an items method

  @items = paginate current_user.items, :page => params[:page]

  haml :'items/index'
end

# then in your view index.haml

!= pagination @items

Customize the markup?

pagination haml
# Spits out the pagination haml markup that's being used

# Or if you prefer erb, you can also do that too...
pagination erb

# Then you can just use it as a partial
pagination haml > app/views/pagination.haml

# in your view
!= partial :pagination, :items => @items

FAQs

Package last updated on 10 Jun 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc