Questions tagged [kaminari]

A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Rails 3

A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Rails 3

572 questions
11
votes
4 answers

How to force Kaminari to always include page param?

Kaminari's URL generation omits the page param if it is generating the link back to the first page. However, the application is designed to select a random page if the page parameter is omitted. Kaminari's default behaviour, then, precludes…
Daniel Wright
  • 4,584
  • 2
  • 27
  • 28
11
votes
4 answers

kaminari undefined method `total_pages'

While using kaminari, I got an error. Gemfile: # gem 'will_paginate', '~> 3.0.6' # gem 'will_paginate-bootstrap' gem 'kaminari' lists_controller.rb def index if params[:tag] @lists = List.tagged_with(params[:tag]).order(created_at:…
dongdongxiao
  • 159
  • 1
  • 2
  • 10
10
votes
3 answers

Kaminari pagination control with fixed page link count

I would like to have Kaminari to show pagination links at fixed count with pagination control, for example 10 links on each navigation page. Kaminari default shows 6 page links at first page and the page links continue to grow when you continue…
TonyTakeshi
  • 5,869
  • 10
  • 51
  • 72
8
votes
3 answers

Kaminari without COUNT

Can Kaminari work without hitting the DB with a COUNT(*) query? My app's database is huge and counting the items takes much much longer than getting the items itself, leading to performance issues. Suggestions for other pagination solutions with…
Jonathan Lin
  • 19,922
  • 7
  • 69
  • 65
7
votes
3 answers

how to paginate records from multiple models? (do I need a polymorphic join?)

After quite a bit of searching, I'm still a bit lost. There are a few other similar questions out there that deal with paginating multiple models, but they are either unanswered or they pagainate each model separately. I need to paginate all…
7
votes
1 answer

Sunspot pagination with kaminari

I recently decided to port my indexing engine from sphinx to solr. Having used kaminari with thinking_sphinx I decided to try making use of generic pagination in sunspot https://github.com/sunspot/sunspot/pull/64 /…
maecro
  • 233
  • 2
  • 9
7
votes
1 answer

Month pagination with kaminari

I want to paginate posts by month so I added following scope in Post model class Post include Mongoid::Document include Mongoid::Timestamps scope :by_month, lambda {|end_date| Post.order_by(:created_at => :asc).where(:created_at.gte =>…
zoras
  • 943
  • 1
  • 9
  • 19
7
votes
0 answers

Kaminari (or any pagination) is slow on Joined query

I'm paginating the following query with Kaminari (though I get similar results with will_paginate): Person.joins([:locations=>:location_hour], :friends, :current_images).where(sql_conditions_string).page(params[:page]).per(10) Everything works as…
NAD
  • 615
  • 1
  • 7
  • 20
7
votes
2 answers

Rails 3 - "More" ajax pagination with Kaminari

I am trying to do a "Twitter like" pagination with a "More" button to load results with Kaminari. I found this question here But I can't figure out how to make it works and if it's a good approach. Thanks in advance
invaino
  • 267
  • 1
  • 4
  • 13
7
votes
1 answer

what's exactly the difference in performance between pagy and kaminari gems, and who's better?

in our project, we are using Kaminari in pagination for everything, and it's working pretty well there's a new gem called 'pagy' and in their gem repo on Github they stated that their performance is better than kaminari and will-paginate, but I…
ELTA
  • 1,474
  • 2
  • 12
  • 25
7
votes
1 answer

kaminari paginate via ajax ,remote = true is not affect on view in rails 3

Hello i am using kaminari gem for pagination and i want to do paginatation via ajax . index.html.haml #abc = render :partial => 'anything/anything_lists', collection: @anything_upcoming, as: :anything_schedule #paginator = paginate…
Ajay Barot
  • 1,681
  • 1
  • 21
  • 37
7
votes
5 answers

How to use kaminari theme for zurb foundation

I want to apply a theme for zurb foundation to kaminari pagination. Detault theme can be installed by rails g kaminari:views default. But I couldn't figure out how to install other themes. Especially, theme for foundation is not…
ironsand
  • 14,329
  • 17
  • 83
  • 176
7
votes
1 answer

show all results on one page (gem kaminari)

I have data and they be cut on some pages (10 results per page). code in controller: @messages = Message.order('id DESC').page params[:page] How I can show all results on one page if I want? It similar as 'see all' on page navigate.
achempion
  • 794
  • 6
  • 17
7
votes
1 answer

Rails Kaminari - How to order/paginate arrays?

I'm following the railscast for Kaminari (http://railscasts.com/episodes/254-pagination-with-kaminari). But I'm stuck with the controller part. In my controller, I have something like this: def index @articles = (params[:mine] == "true") ?…
gerky
  • 6,267
  • 11
  • 55
  • 82
6
votes
3 answers

Paginating a shuffled ActiveRecord query

I am attempting to paginate a shuffled ActiveRecord query. The syntax for doing this using the Kaminari gem is: @users = Kaminari.paginate_array(User.all.shuffle).page(params[:page]).per(20) The issue with this is that User.all is re-shuffled on…
neon
  • 2,811
  • 6
  • 30
  • 44
1
2
3
38 39