FAQ Database Discussion Community


ruby `stack level too deep error` when trying to user order param

ruby-on-rails,ruby,kaminari,ruby-2.2,rails-4-2-1
I'm trying to add a sort_by params to a rails app that uses Kaminari for paging. When add the param to the query I get a stack level too deep error. app/controllers/file_items_controller.rb class FileItemsController < AccountsController def index account = Account.includes(:credentials).find params[:account_id] @page = page_param.to_i @tab = 'Files' @credential =...

How config url in Kaminari pagination? '.json' appended automatically

ruby-on-rails-3,url,pagination,format,kaminari
Load table with Kaminari pagination using AJAX. The pagination itself is using AJAX as well. In my controller: def update_user_list modal = render_to_string('tables/_user_table', :layout => false, :formats=>[:html]).html_safe data = { :table => modal } respond_to do |format| format.json { render :json => data } end end In tables/_user_table # Table...

How can I remember a parameter from the previous page so I can go back to it?

ruby-on-rails,kaminari
I was thinking how to go back from an individual listing page to the index page (with the previous page). It's pretty much like "go back" function. But I don't want to always go to the 1st page. The indexed page has parameter of page. localhost:3000/listings?page=2 But inside each listing,...

Rails kaminari per_page url

ruby-on-rails,mongodb,api,kaminari
i try to use kaminari gem with my REST API and MongoDB, so far i can use http://127.0.0.1:3000?page=1 to paginate result. Is there any way to set (per_page attr) from url, like: http://127.0.0.1:3000?page=1&per_page=10 ??...

Showing pagination links based on total number of records

jquery,ruby-on-rails,pagination,will-paginate,kaminari
So i am using rails and want to proceed with either will_paginate or kaminari for pagination. Here is my below requirement. I have lets say 900 records and want to show 10 records per page. So in total i want to show 90 links in pagination like >. So just...

Does Kaminari remote => true wipe out other parameters (like window)?

ruby-on-rails,kaminari,paginator
I am using the kaminari paginator and have it paginating an array fine both with and without ajax. I built the app based off the kaminari example app. However, I just noticed a problem and am trying to figure out if this is a bug or just misuse on my...

How to fix Kaminari paginate error in view?

ruby-on-rails,pagination,kaminari
When I use Kaminari gem with the code: Model: def index @posts = Post.page(params[:page]) end And use it in index.html.erb: It prints the next error: undefined method `paginate' for #<#<Class:0x000000029bbd68>:0x000000029b3dc0> red line on <%= paginate @posts %>. How can I fix this problem? Is my @posts paginable? I think yes....