Created
October 26, 2010 17:18
-
-
Save zporter/647331 to your computer and use it in GitHub Desktop.
Method used to determine if multiple pages are necessary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def if_multiple_pages?(collection, per_page = 10) | |
pages = (collection.size / (per_page || 10).to_f).ceil | |
yield pages if pages > 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment