Skip to content

Instantly share code, notes, and snippets.

@cornerwings
cornerwings / will_paginate.rb
Created September 17, 2011 14:43 — forked from isaacbowen/will_paginate.rb
extends will_paginate to play well with Twitter's Bootstrap
# config/initializers/will_paginate.rb
# tested with will_paginate 2.3 stable
module WillPaginate
class BootstrapLinkRenderer < LinkRenderer
def to_html
links = @options[:page_links] ? windowed_links : []
# previous/next buttons
links.unshift page_link_or_span(@collection.previous_page, 'disabled prev', "&larr; Previous")
links.push page_link_or_span(@collection.next_page, 'disabled next', "Next &rarr;")