app/helpers/application_helper.rb
# Like Blacklight's render_pagination_info but works with kaminari
# returned pagination, eg ActiveRecord
Like Blacklight's render_pagination_info but works with kaminari
returned pagination, eg ActiveRecord
Like Blacklight ' s render_pagination_info but works with kaminari returned pagination eg ActiveRecord
def render_kaminari_info(pageable_list, options = {})
      per_page = pageable_list.limit_value
      current_page = pageable_list.current_page
      num_pages = pageable_list.num_pages
      start = ((current_page - 1) * per_page) + 1
      total_hits = pageable_list.total_count
      start_num = format_num(start)
      end_num = format_num(start + pageable_list.length - 1)
      total_num = format_num(total_hits)
      entry_name = options[:entry_name] ||
      (pageable_list.empty? ? 'entry' : pageable_list.first.class.model_name.human)
      if num_pages < 2
        case pageable_list.length
        when 0; "No #{h(entry_name.pluralize)} found".html_safe
        when 1; "Displaying <b>1</b> #{h(entry_name)}".html_safe
        else; "Displaying <b>all #{total_num}</b> #{entry_name.pluralize}".html_safe
        end
      else
        "Displaying #{h(entry_name.pluralize)} <b>#{start_num} - #{end_num}</b> of <b>#{total_num}</b>".html_safe
      end
  end
def render_kaminari_info ( pageable_list , options = { } ) per_page = pageable_list . limit_value current_page = pageable_list . current_page num_pages = pageable_list . num_pages start = ( ( current_page - 1 ) * per_page ) + 1 total_hits = pageable_list . total_count start_num = format_num ( start ) end_num = format_num ( start + pageable_list . length - 1 ) total_num = format_num ( total_hits ) entry_name = options [ :entry_name ] || ( pageable_list . empty? ? 'entry' : pageable_list . first . class . model_name . human ) if num_pages < 2 case pageable_list . length when 0 ; "No #{h(entry_name.pluralize)} found" . html_safe when 1 ; "Displaying <b>1</b> #{h(entry_name)}" . html_safe else ; "Displaying <b>all #{total_num}</b> #{entry_name.pluralize}" . html_safe end else "Displaying #{h(entry_name.pluralize)} <b>#{start_num} - #{end_num}</b> of <b>#{total_num}</b>" . html_safe end end
Like Blacklight's render_pagination_info but works with kaminari
returned pagination, eg ActiveRecord
Like Blacklight ' s render_pagination_info but works with kaminari returned pagination eg ActiveRecord
pageable_list
<not_specific>
options
<not_specific>