I'm working with the Rails mislav-will_paginate plugin to paginate my records. I want to produce the following output, regardless of whether there were multiple pages:
X - Y of Z
1 - 100 of 1826
will_paginate in WillPaginate::ViewHelpers returns nil if there was only one page of records. I want to override this in the cleanest possible way to produce the above output if there was only one page, or the above output surrounded by the usual output if there were multiple pages.
I've overridden WillPaginate::LinkRenderer's to_html method to produce this output, but I can't figure out how to produce it if there is only one page of records.
Should I be moving the code to produce X - Y of Z somewhere else and calling it both from my overridding to_html method, and from the place where I make my will_paginate call if it returns nil? If so, where should it live?