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

Kaminari on rails4 error

I have problem with kaminari gem. I have forum controller. On forum controller show action.View for show action is table with all topics associated with this forum. It looks like this: class ForumsController < ApplicationController before_action…
Mateusz Urbański
  • 7,352
  • 15
  • 68
  • 133
0
votes
1 answer

undefined method `page' for # Kaminari::PaginatableArray

I have been using Kaminari since a while. I use to paginate generic arrays using the following line. Kaminari.paginate_array([1,2,3]).page(1).per(1) That use to work before but I noticed that since yesterday this show the error undefined method…
0
votes
3 answers

Endless paging and ajax refresh

I currently have endless paging setup like so: events_controller.rb class EventsController < ApplicationController respond_to :html, :js def index @events = Event.page(params[:page]).per(5) respond_with(@events) …
keruilin
  • 16,782
  • 34
  • 108
  • 175
0
votes
0 answers

rails form_tag leaving sticky params in pagination url generated by the kaminari gem

I have a form_tag declaration: <%= form_tag(:action => :index) do %> It was working fine until I upgraded to Rails 4. Now all the params from this form continue to stay in the address bar, and forcing their value on all future invocations of this…
Anil
  • 3,899
  • 1
  • 20
  • 28
0
votes
1 answer

How to monkey patch gem helper (kaminari)?

I'm trying to monkey patch a gem's view helper method without success. It's being ignored and the original gem code runs. Where should I put the file to have it run? I created the file lib/kaminari.rb containing (lib/ is in load path): module…
rigyt
  • 2,219
  • 3
  • 28
  • 40
0
votes
2 answers

Rails Kaminari - How to Show Pagination Links at the Top and Bottom of the Page?

The title pretty much says it all. I don't want the user to have to scroll back to the top before they can select the next page. I can pull out the query string and write my own logic to build the appropriate links, but I can't believe this isn't…
JosephK
  • 668
  • 10
  • 18
0
votes
1 answer

kaminari and page from elasticsearch

Is it possible to have Kaminari helper and use already paginated data: 1. I query elasticsearch and make all pagination there get 10 records from 2 page. 2. Then I get model instances 3. instances should be shown on UI with page buttons e.g. 1,2,3…
Volodymyr
  • 1,136
  • 3
  • 11
  • 28
0
votes
1 answer

Kaminari paginating arrays

In rails 4.0.0. Why does this work @employees = Employee.where(:club_id => session[:club_id]).page(params[:page]) but not this? @payments = Payment.where(:club_id => session[:club_id], :trading_date =>…
markhorrocks
  • 1,199
  • 19
  • 82
  • 151
0
votes
2 answers

Paginating a model with attributes from multiple Arrays

I have four types of Rawscores I want to display together in a paginated table. The code looks like: @facebook_scores_today = Rawscore.where(:channel_string => "Facebook", :project => @project, :created_at.gt =>…
Nitish Upreti
  • 6,312
  • 9
  • 50
  • 92
0
votes
1 answer

Rspec test describing listing items on index failing

Rspec/TDD beginner. I have a spec that is failing and I don't know why. Everything works in the browser as it should. I am using Kaminari for pagination, which defaults to 25 items per page. spec: describe "Question Pages" do subject { page…
Dan
  • 641
  • 9
  • 25
0
votes
1 answer

Pagination for partial array

My application retrieves items from remote source something like that: # in the controller @items = RemoteSource(params[:page]) The @items is an array but just the part of whole collection. And I'm trying to paginate it: # in the view paginate…
megas
  • 21,401
  • 12
  • 79
  • 130
0
votes
1 answer

View helper for mongoid-pagination?

In rails, does mongoid-pagination have a view helper that will automatically render the pagination links on a view on which it is applied? Do I have to build my own one instead. For example with Kaminari you can use <%= paginate @pets %> on your…
General_9
  • 2,249
  • 4
  • 28
  • 46
0
votes
1 answer

kaminari pagination error undefined method

this is my post_controller def index @posts = Post.all.page(params[:page]).per(2) respond_to do |format| format.html # index.html.erb format.json { render json: @posts } end end this is /views/posts/index <%= paginate @posts %> and i…
user2350547
0
votes
1 answer

How to test sunspot search results or hits

I am getting an error while testing an index page which uses sunspot search. *** NoMethodError Exception: undefined method `[]' for nil:NilClass The code which i wrote is @object.hits This error also occurs with @object.results I have tried…
RailsEnthusiast
  • 1,251
  • 2
  • 12
  • 18