Sha256: 71c87ecd522d5fe22f0f136dc396c1f398205fa81d204442cc7ff334cb1aeef2

Contents?: true

Size: 365 Bytes

Versions: 5

Compression:

Stored size: 365 Bytes

Contents

module AppFrame::PaginationHelper
  
  def page_range
    return nil if count == 0
    
    range_start = (page - 1) * per_page + 1
    range_end = (page) * per_page
    range_end = count if range_end > count
    
    "<div class='page-range'>Displaying <strong>#{range_start} - #{range_end}</strong> of <strong>#{count}</strong> in total</div>".html_safe
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
app_frame-0.6.1 app/helpers/app_frame/pagination_helper.rb
app_frame-0.5.8 app/helpers/app_frame/pagination_helper.rb
app_frame-0.5.7 app/helpers/app_frame/pagination_helper.rb
app_frame-0.5.6 app/helpers/app_frame/pagination_helper.rb
app_frame-0.5.5 app/helpers/app_frame/pagination_helper.rb