No commit activity in last 3 years
No release in over 3 years
change based on foundation-will_paginate gem, use foundation style pagination and also provides a goto page input area when gap is clicked
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 5.5.0, ~> 5.5
< 5.0.0, >= 4.2.0
 Project Readme

Grasshopper Pagination

Integrates Zurb Foundation's pagination styles with will_paginate.

Based on foundation-will_paginate with several changes:

  • When gap is clicked, display an input field for exact page number, hit enter will navigate the the particular page
  • Change default inner_window to 1
  • When total count is no more than 1.5 times of per_page count, do not show pagination links, display all records

Installation

Add this line to your application's Gemfile:

gem 'grasshopper_paginate'

And then execute:

$ bundle

Or install it yourself as:

$ gem install grasshopper_paginate 

Configuration

Include assets

application.js
//= require grasshopper_paginate/paginate

application.css
//= require grasshopper_paginate/paginate

Usage

For paginated query, with will_paginate, you woul usually use

@users = User.paginate page: params[:page]

Now use

@users = User.smart_paginate page: params[:page]

In your view where you would usually use

<%= will_paginate @posts %>

Now use

<%= grasshopper_paginate @posts %>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request