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
3
votes
0 answers

kaminari ajax pagination works locally, not on heroku production

i am trying to get ajax pagination to work with Kaminari in my production environment on Heroku. At present running the code locally in dev mode it all seems to work. i cant seem to find what would be causing it to work locally, but not in…
Boss Nass
  • 3,384
  • 9
  • 48
  • 90
3
votes
1 answer

Kaminari with Rails 3 not displaying

I realise paginating with Kaminari is supposed to be simple, but I seem to be missing something... My guidelines_controller.rb index action is def index if params[:search].present? @search = Sunspot.search(Guideline) do fulltext…
tessad
  • 1,209
  • 3
  • 20
  • 40
3
votes
0 answers

How can I set initial offset for first page in kaminari?

I need to implement some logic for to show 3 elements on the first page and by 1 element on all the next. For the first page there is no problems: items = @model.limit(@first_page_items) and for all the next ones i…
sandric
  • 2,310
  • 3
  • 21
  • 26
3
votes
1 answer

find page for given record using kaminari

Ruby on Rails 3 project. After updating a record we return to the index of all records (not a view of the updated record). The index is paged with Kaminari. How do we return to the page of the index that contains the updated record?
Douglas Lovell
  • 1,549
  • 17
  • 27
3
votes
1 answer

undefined method `current_page' for # kaminari

Rails 3.2.8 im using kaminari to do pagination, but i keep getting error: undefined method `current_page' for # in posts_controller.rb def index @posts = Post.order(:created_at).page(params[:page]) end in views/posts/index.html.erb <%= paginate…
Nitrino
  • 51
  • 1
  • 3
3
votes
3 answers

Validate page number when using Kaminari

I am using Kaminari to handle pagination. I recently found out that a lot of bogus request is requesting an invalid page number, such as /post/page/undefined. Since I am using Solr, bad page number got passed into it and cause 500 error. I want to…
lulalala
  • 17,572
  • 15
  • 110
  • 169
3
votes
2 answers

Rails Spree Kaminari infinite scrolling for the products page

I've tried to use this tutorial Kaminari endless page and also watched Ryan Bates episode #114 Endless Page (revised) and tried to implement an infinite scrolling functionality to my online store. I don't know for sure how to apply the products…
raulp
  • 196
  • 2
  • 15
3
votes
3 answers

Union two mongo results

I have a situation where I need to return a single collection of objects from mongo, but need to use two queries to get the results. The order of these results is important because they are paginated. Here's the first query: (listings based on a…
Levi Rosol
  • 4,398
  • 6
  • 28
  • 36
3
votes
1 answer

Always show pagination controls for Kaminari

Is there a way to make Kaminari always show pagination controls even when total page count is 1?
saneshark
  • 1,243
  • 13
  • 25
3
votes
1 answer

Paginating with kaminari on a custom route

I'm having a problem with kaminari, it doesn't seem to be able to paginate results when using a custom "unRestful" url. resources :provinces, :path => '', :only => [ :show ] do resources :sports, :only => [ :show ] do match ':page',…
ngw
  • 1,222
  • 1
  • 14
  • 34
3
votes
1 answer

Where does Kaminari calculate it's page url links?

I'm working with a custom model that I made that pretends to be a table based ActiveRecord object. It is instead backed by a SQL view. There's some trickery behind the scenes. The problem is that pagination links with Kaminari aren't working…
barancw
  • 888
  • 9
  • 18
3
votes
1 answer

Kaminari doesn't work If my query is in the model

I have my mongoid query in the model def self.get_result collection_name, hash_params, page, per_page self.collection_name = collection_name @result_pg = self.where(hash_params).page(page).per(per_page) end I have it here because my…
Abhay Kumar
  • 1,582
  • 1
  • 19
  • 45
3
votes
2 answers

Rails3 Kaminari &Mobile Devices

I've implemented Kaminari in my views to paginate. Now I've implemented my app to detect mobile via the railscast instructions http://railscasts.com/episodes/199-mobile-devices. Pagination works fine while not in mobile. When I switch to mobile…
jcrocket
  • 33
  • 4
3
votes
2 answers

undefined method `paginate' for

I am using Ruby on Rails 3.2.1 and Kaminari gem 0.13.0. I have added gem 'kaminari' in my gemfile, then ran Bundle install. In controller I have @posts = Post.order("name").page(params[:page]) In view: <%= paginate @posts%> <%…
RydelHouse
  • 235
  • 1
  • 8
  • 19
2
votes
1 answer

Pagination of a partial with Kaminari in Rails 3

Here is another Newbie question on Rails 3: I have a model called "Activity". On the show.html.erb page of an activity, I show the comments that belong to this activity as a partial: <%= render :partial => @activity.comments %> How the comments…
The_Fritz
  • 452
  • 3
  • 17