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
4
votes
2 answers

undefined method `page' for #

Im trying to install Kaminari pagination on rails 3 with adminpanel RailsAdmin, but I get this error: NoMethodError in ShowsController# undefined method `page' for # < ActiveRecord::Relation:0xaadc8d4>
4
votes
1 answer

Rails: How do I paginate multiple models with kaminari?

I have some code like this in a controller: def index @plays = current_user.plays.includes(:game).order("created_at desc") @wants = current_user.wants.includes(:game).order("created_at desc") @ratings =…
Clayton Correia
  • 263
  • 1
  • 3
  • 16
4
votes
1 answer

Using Simple Search with Kaminari Pagination Gem

I am trying to apply pagination to my rails app using Kaminari. I am also incorporating a simple search form based on the Railscast Episode #37. When I try to apply the kaminari page and per methods I get the error 'undefined method page'. Below…
Aaron
  • 143
  • 3
  • 10
4
votes
2 answers

Kaminari and Capybara conflict

I seem to have some sort of conflict between the page method of capybara and the page method of Kaminari. That's what I guessed, anyway, here is the error : Failure/Error: before { sign_in_as user } ActionView::Template::Error: wrong…
Gabriel Dehan
  • 1,107
  • 9
  • 15
4
votes
3 answers

kaminari pagination inside bootstrap tabs

My project is using twitter bootstrap tabs and in each tab there is collection of Rails Model Object. i need to use kaminari pagination for the collection in each tab. As, in every tab there will be a pagination for the content of this tab from…
4
votes
1 answer

Run kaminari specs

this is probably a stupid question but I can't seem to find the answer. I'd like to contribute to kaminari, so I forked the repo, bundle'd it, and now I would like to run the specs to ensure all's green. But I can't seem to make it work : bin/rake…
ksol
  • 11,835
  • 5
  • 37
  • 64
3
votes
1 answer

Kaminari and unscoped

i can not get Kaminari work together with unscope, here's what I'm experiencing, https://gist.github.com/1330721 Any thoughts on this?
leomayleomay
  • 553
  • 1
  • 7
  • 16
3
votes
1 answer

How to specify a controller & action for Ajax pagination with Kaminari?

I'm using the Kaminari gem for my ruby on rails application (For anybody still using will_paginate, I would recommend to consider switching! Much cleaner and more versatile). The problem I have is that I want to specify a controller action when…
geb2011
  • 461
  • 5
  • 15
3
votes
3 answers

Why is Kaminari displaying 4 / all records when there is a `limit` being applied?

In Rails console, I do: Video.count Returns 4 Video.limit(2) Returns 2 v = Video.limit(2) vv = v.page(1).per(20).count Returns 4 Why is Kaminari displaying 4 / all records when there is a limit being applied? Shouldn't it return 2 instead?
Christian Fazzini
  • 19,613
  • 21
  • 110
  • 215
3
votes
2 answers

How do you use Kaminari to paginate a page by a number value?

I've set up Kaminari so that it can accurately paginate by post title if i do this: def index ... @posts = Post.order('title').page(params[:page]).per(5) ... end i also have <% paginate %> in the view but if I try something like this @posts =…
Jon
  • 129
  • 1
  • 9
3
votes
1 answer

ActiveAdmin still does subquery_for_count even when pagination_total: false

I have a redshift table in the billions of records, lets call it SomeModel. ActiveAdmin.register Redshift::SomeModel do menu parent: 'Redshift' config.filters = true config.sort_order = '' <-- I figured out this removes the order by, which is…
Andrew Wei
  • 2,020
  • 1
  • 17
  • 28
3
votes
2 answers

Endless scroll pagination in ruby on rails with one query per page?

The problem with your typical rails pagination gem is that it does 2 queries: one for the page you're on and one for the total count. When you don't care about how many pages there are (e.g. in an endless scroll), that 2nd query is unnecessary (just…
Brian
  • 2,499
  • 3
  • 24
  • 26
3
votes
2 answers

Paginate by most recent post with kaminari

I'm using the rails gem kaminari (https://github.com/amatsuda/kaminari) in order to paginate my posts database. Currently I have the code @posts = Post.order('id').page(params[:page]).per(5) in my controller, but this orders the pages from earliest…
Vasseurth
  • 6,354
  • 12
  • 53
  • 81
3
votes
1 answer

Eager loading a polymorphic association with Kaminara pagination

I'm trying to eager load a polymorphic association while also paginating using the Kaminari gem: @news_items = NewsItem.includes(:news_source).not_outdated .where(:group_id => group_ids).order("created_at DESC").page(params[:page]).per(10) I'm…
3
votes
2 answers

Rails kaminari: How to specify total_count for paginate?

COUNT query to find out total_count sometimes very slow. But if I am caching values of items_amount or such field in model I want to use it for kaminari pagination. EXAMPLE: I have model Category (:id, :title, :items_amount) And then on show view I…