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
6
votes
1 answer

Is there a way to remove the pagination from an ActiveRelation object?

Let's say we have @posts = Post.published.per(10).page(params[:page]) somewhere in our controller. Later on we need to update all published posts (Post.published). How should one remove the pagination? @posts.limit(false).offset(false) seems to do…
Kostas
  • 8,356
  • 11
  • 47
  • 63
6
votes
1 answer

ActionView::Template::Error (undefined method `silence' for)

I have very strange problem on heroku. I have view that looks like this: = content_for :header_title do = t('.header_title') - if @appointments.exists? %table.table.table-striped.table-bordered.table-hover %thead %tr %th=…
Mateusz Urbański
  • 7,352
  • 15
  • 68
  • 133
6
votes
2 answers

Kaminari: undefined method `total_pages' for Array

Using Rails & Kaminari gem, I am getting the below error when I render my view: undefined method `total_pages' for #Array:0x007faa486583e0 controller: def index @user = current_shop.users.new @users = current_shop.active_users ### This…
Jackson Cunningham
  • 4,973
  • 3
  • 30
  • 80
6
votes
2 answers

kaminari pagination on custom url

I have a case on url that generated by kaminari paginate as the url depends on a condition. Here is my routes concern :search do scope '/search', as: :search do get '/', to: 'users#search' get '/schedule/:id', to: 'schedules#doctor', as:…
spondbob
  • 1,523
  • 2
  • 17
  • 34
6
votes
2 answers

Is it possible to add an anchor/param to links with Kaminari?

I'm using pagination with Kaminari. It's working awesome. One thing that I want for now is, adding #comment_section behind the url that Kaminari generates. For example, my views is just like this. I'd like it to goes to the top of this section…
Foo
  • 800
  • 1
  • 7
  • 17
6
votes
2 answers

Rails caching: Expiring multiple pages for one action

I've set up action caching (with sweepers, but I guess that's irrelevant here) in my app, and so far it works great except for one thing: I use Kaminari for pagination, and thus when I execute expire_action on my action it only expires the first…
rogerkk
  • 5,494
  • 5
  • 37
  • 53
5
votes
2 answers

How do you configure a different page size for production and test for Kaminari

I'm running some rspec unit tests involving getting data back through kaminari paging, but the default page size for our application is 20, whereas 2 would work fine for test. How do a set a different configuration for the default kaminari page size…
Steve Mitcham
  • 5,268
  • 1
  • 28
  • 56
5
votes
2 answers

Forcing ActiveRecord to count distinct (with Kaminari)

I'm using Kaminari to paginate some result from a query in which I'm selecting distinct records. Consider the following controller code: @things = Thing.joins... # create a complex query that produces duplicate results # I want to select distinct…
balexand
  • 9,549
  • 7
  • 41
  • 36
5
votes
1 answer

Rails Kaminari: items per page how to set up

I'm trying using the Kaminari pagination to have a box where a user can set how many items per page to display. I have an issue with it because I'm getting the error `undefined method to_i' for :limit:Symbol Did you mean? to_s I set up this in a…
Jakub
  • 2,367
  • 6
  • 31
  • 82
5
votes
1 answer

How to Enable `raise_on_unfiltered_parameters` to respect parameter filtering while using wice_grid gem for rails 5

First, I do know that wice_grid gem is not supporting rails 5 as of now. So, there are issues already flowing around the web. But now I can't go back as I am in the middle of my web app development. Issue: I want a simple datagrid having filter…
Priyesh Doshi
  • 320
  • 3
  • 13
5
votes
2 answers

Jump to the midde with Kaminari pagination

Say I have 30 pages being paginated with Kaminari: #800 books, 25 per page =paginate @books, :outer_window => 3, :window => 3 It looks like this: 1 2 3 4 … 30 31 32 There's no way to get to page 16 without clicking 5 times. 1* 2 3 [ 4 ] … 30 31…
Ashbury
  • 2,160
  • 3
  • 27
  • 52
5
votes
2 answers

Rails smart_listing configuration

I'm trying to setup the smart_listing gem in my app. Where and how can I configure the default per page number of pagination results. In the docs of smart_listing is mentioned that it uses kaminari.
Xelas
  • 57
  • 1
  • 6
5
votes
1 answer

Kaminari if next page exists?

What is the method in kaminari to know if next page exists? With will_paginate its simple you just call in next_page? on model. I wonder if there is anything in kaminari
Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
5
votes
3 answers

kaminari undefined method 'page'

I am trying to add Kaminari to my Rails app. I have included the gem and this is what my controller looks like: def index if params[:year] if params[:year].size > 0 @songs = Song.where("year like ?",…
user2184718
  • 675
  • 1
  • 12
  • 30
5
votes
1 answer

jquery_ujs conflicts with Kaminari AJAX in Rails 4?

Short version; jquery_ujs appears to conflict with Kaminari's AJAX support and I don't know why. In my Rails 4 app, I have the following lines in my application.js //= require jquery //= require jquery_ujs //= require turbolinks //= require…
NBarnes
  • 109
  • 6
1 2
3
38 39