GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - freddy-dev/will_paginate: Pagination library for Rails 3, Sinatra, Merb, DataMapper, and more

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

515 Commits
515 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
spec
spec
 
 
.gitignore
.gitignore
 
 
.rspec
.rspec
 
 
.travis.yml
.travis.yml
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
Gemfile.rails3.0
Gemfile.rails3.0
 
 
Gemfile.rails3.0.lock
Gemfile.rails3.0.lock
 
 
Gemfile.rails3.1
Gemfile.rails3.1
 
 
Gemfile.rails3.1.lock
Gemfile.rails3.1.lock
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
init.rb
init.rb
 
 
will_paginate.gemspec
will_paginate.gemspec
 
 

Repository files navigation

will_paginate

will_paginate is a pagination library that integrates with Ruby on Rails, Sinatra, Merb, DataMapper and Sequel.

Installation:

## Gemfile for Rails 3, Sinatra, and Merb
gem 'will_paginate', '~> 3.0'

See installation instructions on the wiki for more info.

Basic will_paginate use

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

# or, use an explicit "per page" limit:
Post.paginate(:page => params[:page], :per_page => 30)

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

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

You can customize the default "per_page" value:

# for the Post model
class Post
  self.per_page = 10
end

# set per_page globally
WillPaginate.per_page = 10

New in Active Record 3:

# paginate in Active Record now returns a Relation
Post.where(:published => true).paginate(:page => params[:page]).order('id DESC')

# the new, shorter page() method
Post.page(params[:page]).order('created_at DESC')

See the wiki for more documentation. Ask on the group if you have usage questions. Report bugs on GitHub.

Happy paginating.

About

Pagination library for Rails 3, Sinatra, Merb, DataMapper, and more

github.com/mislav/will_paginate/wikis

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.