Module: Pagination::TotalPagesForHelper

Instance Method Summary collapse

Methods included from PageSizeForHelper

#pagination_page_size_for

Methods included from RecordSizeForHelper

#pagination_record_size_for

Instance Method Details

#pagination_total_pages_for(set) ⇒ Object



11
12
13
14
15
16
# File 'lib/action_set/helpers/pagination/total_pages_for_helper.rb', line 11

def pagination_total_pages_for(set)
  total_set_size = pagination_record_size_for(set)
  return 1 if total_set_size.zero?

  (total_set_size.to_f / pagination_page_size_for(set)).ceil
end