Wrapping a div around will_paginate page_entries_info

The page_entries_info view helper looks great, but it is just plain text; I can’t add margin or padding or float it. Here’s a quick alias_method to wrap it up in a div with the class of your choice.

Just drop that into an file in config/initializers, restart, and get styling!

  • JS

    Hmm.. I dropped that into config/initializers/will_paginate.rb and I now get “undefined method page_entries_info' for moduleWillPaginate::ViewHelpers’” when I attempt to start rails.  So, it seems to be attempting to process this file before it loads the will_paginate gem (Rails 3.0.7).

  • JS

    Hmm.. I dropped that into config/initializers/will_paginate.rb and I now get “undefined method page_entries_info' for moduleWillPaginate::ViewHelpers’” when I attempt to start rails.  So, it seems to be attempting to process this file before it loads the will_paginate gem (Rails 3.0.7).

  • Jonathan Julian

    That initializer works for Rails 2.3.x – since you’re on Rails 3, try a newer pagination gem: https://github.com/amatsuda/kaminari