Module: PaginationHelper
- Included in:
- Kakimasu::KeysController, Kakimasu::TranslationsController
- Defined in:
- app/helpers/pagination_helper.rb
Instance Method Summary collapse
- #get_page_size ⇒ Object
-
#set_page_size(size) ⇒ Object
Set page size.
-
#total_pages(array) ⇒ Object
Calculates total number of pages.
Instance Method Details
#get_page_size ⇒ Object
7 8 9 |
# File 'app/helpers/pagination_helper.rb', line 7 def get_page_size @size end |
#set_page_size(size) ⇒ Object
Set page size
3 4 5 |
# File 'app/helpers/pagination_helper.rb', line 3 def set_page_size(size) @size = size end |
#total_pages(array) ⇒ Object
Calculates total number of pages
12 13 14 |
# File 'app/helpers/pagination_helper.rb', line 12 def total_pages(array) (array.length.to_f / @size).ceil end |