My internal website search engine, based on pg_search, sometimes returns so much text in its search results that Heroku cannot load the page.
The problem is, some search results are so long that I could only publish one of them per page, whereas others are so short I could easily publish 20 of them at once.
So I'd like to pagination my search results, but I'd like to limit the amount of content I publish on each page by word count, not by result count.
I've taken a look at the main pagination gems on Ruby Toolbox like will_paginate, but I can't find any that offer this function.
Does a suitable gem exist? Or is there any a straightforward way of doing this with a gem like will_paginate?