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

Modifying a SQL query for use with 'will_paginate' in Ruby

I have the following SQL query which I use to fetch some rows from a mySQL database : SELECT code_ver, result FROM mastertest WHERE date >= DATE_SUB( (CURDATE()) , INTERVAL 90 DAY) ORDER BY date DESC; This query gives me data from the past 90 days.…
Pi Horse
  • 2,350
  • 8
  • 30
  • 51
0
votes
1 answer

Using paginate while fetching results by a SQL query in ruby

I have the following query in my Rails Controller: SELECT CODE_VER FROM MASTERTEST WHERE DATE>= DATE_SUB(CURDATE(), INTERVAL 90 DAY) ORDER BY DATE DESC; This query returns me results from the last 90 days. I display all these results in a table…
Pi Horse
  • 2,350
  • 8
  • 30
  • 51
0
votes
1 answer

RangeError Exception: offset 25 and limit 25 are outside allowed range Pagination Kaminari

I am trying to paginate some items from my database however I am getting this error when I try to go onto page two of my pagination: RangeError Exception: offset 25 and limit 25 are outside allowed range This is the code in my controller that sets…
Hugs
  • 915
  • 4
  • 20
  • 47
0
votes
1 answer

kaminari-bootstrap conflicts with active admin

My rails project utilizes Twitter Bootstrap for the main site's look and feel. In order to make kaminari fit in a bit better, I added the kaminari-bootstrap gem. So far, so good. The problem is that the kaminari-bootstrap HTML breaks the pagination…
0
votes
1 answer

Kaminari endless paging issue

I am trying to use Kaminari + jQuery to do endless pagination / infinite scrolling. I am trying to append the paginated results (rows) within a table. Unfortunately, the results (row markup) appear above the table. Here's my existing…
keruilin
  • 16,782
  • 34
  • 108
  • 175
0
votes
5 answers

Kaminari pagination layout is broken

I have a trouble with kaminari pagination and bootstrap styles. Pagination works fine, but styles are broken. Is there any way to fix it? or is there any other style sheets for kaminari pagination? here is a screenshot…
azaytc
  • 63
  • 2
  • 9
0
votes
1 answer

How to apply sorting and pagination when accessing objects of current_user?

I'm using Rails 3.2 and Kaminari for pagination. I'm using the same controller action (index) for rendering all articles and all articles of a specific user. My controller code looks like this: def index @articles = (params[:mine] == "true") ?…
gerky
  • 6,267
  • 11
  • 55
  • 82
0
votes
1 answer

Double pagination using Kanimari with Ajax Rails 3.2

My app is almost complete, now I am messing with cosmetics, and decided to do some pagination. will_paginate for me did not work, so I tried Kanimari, which is working whenever is not using Ajax. My problem is I have a page with 2 pagination indexes…
Vinchbr
  • 49
  • 4
0
votes
1 answer

Kaminari RoutingError

I have 2 models docs and categories. The relations are: a doc belongs to one category. a category has many docs. I want to paginate over all docs and docs from a specific category. Here is what i did with kaminari readme in routes.rb (well, am…
Dmitriy
  • 341
  • 2
  • 13
0
votes
2 answers

kaminari with ror to pagination

i am trying to pagination with kaminari for first time and i got error: views/store/index.html.erb where line #23 raised: undefined method `current_page' for # Extracted source (around line #23): 20:
21:
22:…
marios
  • 153
  • 1
  • 14
0
votes
1 answer

how can I set a limit for a particular scope if I'm using kaminari

I'm using the kaminari gem for pagination. I want to only show the 10 most recent items that were added. For the other scopes I can show up to 30. Here is the index action of the Resources controller: @filt= params[:filter] || 'no_filter' …
chell
  • 7,646
  • 16
  • 74
  • 140
0
votes
0 answers

Programming non-persistent Pagination array in rails 3

I have a question about paginating non-persisted data which is sourced from a remote http request to an API (or many). My Rails 3 app sends a net/http request to a search engine API and receives a JSON object. I'm loading this into ruby and…
iNulty
  • 923
  • 8
  • 17
0
votes
1 answer

Rails 3. Find documents of a certain category with a has_many through association

I have the following models Document has_many :document_categorizations has_many :document_categories, through: :document_categorizations DocumentCategory has_many :document_categorizations has_many :documents, through:…
leonel
  • 10,106
  • 21
  • 85
  • 129
0
votes
2 answers

How to select as in pagination in rails?

I have such code @pre_articles = Article.find(:all, :conditions => { :ART_ID => @linkla.map(&:LA_ART_ID)}) @articles = Kaminari.paginate_array(@pre_articles).page(params[:page]).per(15) It's selecting for me array of data, but it's huge, so i…
byCoder
  • 3,462
  • 6
  • 28
  • 49
0
votes
1 answer

Kaminari: Objects do not shift from second page to first page when objects on first page is removed

I use Kaminari for my Rails 3.2.0 site pagination. I'm hiding my deals object from displaying on the view by filtering it with <% if !traveldeal.expired? %> where expired is a boolean. I display 9 traveldeals per page as shown in my controller for…
Huy
  • 10,806
  • 13
  • 55
  • 99