def paginate resource
        current_page = (controller.params[:page] || 1).to_i
        per_page     = (controller.params[:pp]   || BootstrapAdmin.paginator_page_size).to_i
        count        = resource_count(resource)
        pages        = (count.to_f/per_page).ceil
        paginator = {
          :current_page => current_page,
          :count        => count,
          :pages        => pages > 0 ? pages : 1
        }
        items = resource.offset( (current_page-1)*per_page ).limit(per_page)

        return items, paginator
      end
def paginate resource
        current_page = (controller.params[:page] || 1).to_i
        per_page     = (controller.params[:pp]   || BootstrapAdmin.paginator_page_size).to_i
        count        = resource_count(resource)
        pages        = (count.to_f/per_page).ceil
        paginator = {
          :current_page => current_page,
          :count        => count,
          :pages        => pages > 0 ? pages : 1
        }
        items = resource.offset( (current_page-1)*per_page ).limit(per_page)

        return items, paginator
      end
=============================================================================