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.

module WillPaginate
  module ViewHelpers
    alias_method :original_page_entries_info, :page_entries_info
    def page_entries_info(collection, options = {})
      "<div class=\"#{options[:class] || 'page_entries_info'}\">" + original_page_entries_info(collection, options) + '</div>'
    end
  end
end

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