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

How to set different page size for the first page in Kaminari?

I have a number of objects I would like to paginate using Kaminari. However, on the first page I would also like to show a notification allowing the viewer to create his own object, reducing the number of objects that can be displayed on that page.…
Pruik
  • 101
  • 1
  • 6
5
votes
5 answers

How to obtain per_page number of a Model in views?

The number of items for a page in Kaminari is defined by: defining per_page member in model, or defining default_per_page in config. My question is, how to obtain that number of items in view? Update Pardon me for being not clear. What I want is…
Ismail Faruqi
  • 482
  • 4
  • 16
5
votes
1 answer

Is there any possible way to fix the url that Kaminari pagination generates?

I was implementing a chat system to my app, in which only the list of comments will be reloaded with ajax submit. Kaminari pagination is used in there, but it gets weird string in its url like this after new comment was submit.…
MKK
  • 2,713
  • 5
  • 31
  • 51
5
votes
2 answers

How do I paginate a hash of arrays using the Kaminari (or will_paginate) gem

I've managed to find a workaround to this now. The index action now has an "order" clause before the call to page and the meals are then sorted and grouped by date. The hackey bit next: @total_pages and @pages are used in the view to provide…
user792649
  • 51
  • 1
  • 4
4
votes
1 answer

Rails: undefined method 'paginates_per'

I'm installing a gem called Carrier https://github.com/stanislaw/carrier/blob/master/Gemfile into a Rails 3.2.1 app. It uses Kaminari and when I did bundle install after adding gem "carrier" to my Gemfile, it showed that I was using kaminari Using…
Leahcim
  • 40,649
  • 59
  • 195
  • 334
4
votes
3 answers

Kaminari ajax pagination only with prev and next button

I want to use Kaminari only with prev and next button. I'm using the next helper: <%= link_to_next_page @object, 'Next', :remote=>true %> but this, show only a link with Next page. I want to know how can I use the helpers link_to_previous_page and…
hyperrjas
  • 10,666
  • 25
  • 99
  • 198
4
votes
4 answers

Ruby/Rails - kaminari undefined method pagination errors

I'm not sure what I did, but kaminari has started acting weird in my app. In my controller: @producers = Producer.order(:name).page(params[:page]) view: <%= paginate @producers %> results in: undefined method `num_pages' for…
johnnycakes
  • 2,440
  • 2
  • 28
  • 36
4
votes
2 answers

How to Install Kaminari Properly?

I'm having a bit problem on how to get Kaminari work. I did the installation procedure in GitHub. gem "kaminari" Then run bundle I have this snippet for index @users = User.order("name") I added this on my view <%= paginate @users %> Then I got…
Ben
  • 1,370
  • 17
  • 42
4
votes
1 answer

How to paginate relations with ruby ​on rails?

I'm studying Ruby On Rails and as a learning goal I made an API with the basic functionality of Instagram. I have difficulty paginating the results of my follower list. I also wanted to display only followers and not user data as it has no return…
Jcsreisjr
  • 53
  • 3
4
votes
2 answers

Rails 3/Kaminari/JQuery - load more button: problem to display results (it loads the entire page layout and not only the partial layout)

Begin with ajax and jquery combined with rails, I am trying to create a "load more" link in the bottom of my user index page. My user index page should display the 10 first users, then clicking the link it loads the next 10 users on the bottom of…
benoitr
  • 6,025
  • 7
  • 42
  • 67
4
votes
3 answers

Kaminari::Cells paginate method not rendering anything

I'm using the Kaminari::Cells gem, and when I use the paginate method in a cell view, nothing shows up. I checked, and the paginate method is just returning "\n".
neurodynamic
  • 4,294
  • 3
  • 28
  • 39
4
votes
1 answer

Kaminari: paginating a list of removable items

Sounds like it should be a common problem, but I couldn't find any info on it. Setup: I have a paginated list of items; each item has a remote: true "Delete" button, so any item can be removed with a remote ajax request. Problem: Once you remove a…
ddgd
  • 1,657
  • 1
  • 15
  • 25
4
votes
2 answers

Rails: pagination with custom offset using Kaminari

I'm using Kaminari for pagination and under a certain situation need the first page to contain only 2 entries while each other to have 6. Thought this was achievable using padding(), but it doesn't seem to work like I'd expect (the documentation…
JJK
  • 179
  • 1
  • 2
  • 9
4
votes
2 answers

Pagination with Elasticsearch, Tire, and Kaminari

I'm having issues getting pagination of search results to work with Elasticsearch, Tire, and Kaminari. I am searching on all models in my application (news, paintings, books) as a general site search and therefore, need a block for the tire search,…
anthony
  • 391
  • 1
  • 3
  • 15
4
votes
3 answers

Reverse pagination with kaminari?

I am using Kaminari 0.13.0 with RubyOnRails 3.2.8. Lets assume I have a default ordering of my elements by crated_at, I have 8 elements in my list {a, b, c, d, e, f, g, h} and I paginate them 3 per page. By default kaminari will create the…
Wojtek B.
  • 927
  • 2
  • 9
  • 17