Giter VIP home page Giter VIP logo

will_paginate_renderers's Introduction

Will Paginate Renderers

A collection of custom renderers for use with the will_paginate gem.

Requirements

will_paginate_renderers currently depends explicitly on will_paginate 3.0.pre4, but will in the future support any 3.0.x version once a stable version is released.

The easiest way to make use of will_paginate_renderers is through Bundler by adding the following to your Gemfile:

gem 'will_paginate'
gem 'will_paginate_renderers'

Note that although will_paginate_renderers lists will_paginate as a dependency, you still need it in your Gemfile in order to make sure it's required properly.

Once installed, just tell the will_paginate helper which renderer to use (see below).

Renderers Provided

Gmail

Preview:

Usage:

will_paginate(@posts, :renderer => WillPaginateRenderers::Gmail)

Customization

You can change the label and CSS class of the "Newest", "Newer", "Older" and "Oldest" links, and you can change the CSS class of the "window" span, which is the text that shows the current, end and total counts.

WillPaginateRenderers.pagination_options[:gmail_newest_label] = "Newest"
WillPaginateRenderers.pagination_options[:gmail_newer_label]  = "Newer"
WillPaginateRenderers.pagination_options[:gmail_older_label]  = "Older"
WillPaginateRenderers.pagination_options[:gmail_oldest_label] = "Oldest"

WillPaginateRenderers.pagination_options[:gmail_newest_class] = 'newest'
WillPaginateRenderers.pagination_options[:gmail_newer_class]  = 'newer'
WillPaginateRenderers.pagination_options[:gmail_older_class]  = 'older'
WillPaginateRenderers.pagination_options[:gmail_oldest_class] = 'oldest'
WillPaginateRenderers.pagination_options[:gmail_window_class] = 'window'

Twitter

Preview:

Usage:

will_paginate(@posts, :renderer => WillPaginateRenderers::Twitter)

Customization

You can change the label and CSS class of the "More" link.

WillPaginateRenderers.pagination_options[:twitter_label] = "View More"

WillPaginateRenderers.pagination_options[:twitter_class] = 'custom_css'

Note on Patches/Pull Requests

  • Fork
  • Code
  • Commit
  • Push
  • Pull Request

Please feel free to fork and add your own renderers. Be sure to send a pull request when you're done! If you're not able or willing to add one yourself, feature requests are more than welcome; just open a new issue.

Copyright

Copyright (c) 2010 Robert Speicher. See LICENSE for details.

will_paginate_renderers's People

Contributors

rspeicher avatar

Stargazers

Chris Nwachukwu avatar  avatar carlos segura avatar soend avatar Linux on Rails avatar A Flores avatar Ray Dookie avatar Matt Coneybeare avatar raecoo avatar

Watchers

 avatar James Cloos avatar

Forkers

healthtap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.