Questions tagged [will-paginate]

Ruby pagination library

A pagination library for Ruby that integrates with popular web frameworks and database drivers. See the will_paginate documentation.

859 questions
0
votes
1 answer

Paginate using with_exclusive_scope

Is there a way in which we can paginate using with_exclusive_scope in Rails 2.3? @albums = Album.paginate(:page => 1, :per_page => 12, :conditions => cond) works fine. Album.with_exclusive_scope {find(:all, :conditions => cond)} works fine. Can…
vishal
  • 279
  • 4
  • 14
0
votes
2 answers

How to show parent and child in view with will paginate?

I'm having trouble showing my view correctly. I have this as my code right now: <% for store in @stores %> <% store.name %> <% @stores.products.each do |p| %> <% p.name %> <% end %> <% end %> def index @stores = Store.paginate(:page…
LearningRoR
  • 26,582
  • 22
  • 85
  • 150
-1
votes
2 answers

Configuring Sphinx Search localization (spanish)

I'm using a Sphinx search engine to perform my searches in a Rails project, through Thinking Sphinx gem. My site is in spanish, so I need to have text obtained from Sphinx translated too. I'm using page_entries_info helper to retrieve the search…
dgilperez
  • 10,716
  • 8
  • 68
  • 96
-1
votes
1 answer

method "where" does not work when switched from will_paginate to pagy gem in rails

My will_paginate code in controller: @posts = Post.paginate(page: params[:page], per_page: 100).order('created_at DESC') My pagy code that replaced it: @pagy, @posts = pagy_countless(Post.order('created_at DESC'), items:5, link_extra: 'class=""…
superbot
  • 401
  • 3
  • 19
-1
votes
1 answer

DRY Pagination for complex POST action

I implemented a stats panel in my current project. It's possible to select people by specific objects (different Models) which allows you for example to search for people which belong to in Group B, Organisation A and Flag A (Group B ∩ Organisation…
Tunnelblick
  • 137
  • 2
  • 11
-1
votes
4 answers

will-paginate broken with Rails 5.1?

Ever since upgrading to Rails 5.1, I get the following error when trying to paginate unfiltered (but not filtered) user table results: I use will-paginate 3.1.6 and Rails 5.1.0. I'm not even sure which line is causing the error; presumably it's the…
Sprachprofi
  • 1,229
  • 12
  • 24
-1
votes
2 answers

replacing certain column values with "-" in a will_paginate result set without affecting sorting

I have a model table with 3 fields: "id", "amount" and "type". Im calling the paginate method to display the data but I need to replace the amount with "-" if type = "specific_type". I can do this by replacing the values in the view with a "-" if…
udit
  • 2,745
  • 3
  • 33
  • 44
-1
votes
1 answer

Grouping data and pagination with Rails

I have csv import table model: class ImportTable < ActiveRecord::Base has_many :import_cells, :dependent => :destroy end class ImportCell < ActiveRecord::Base belongs_to :import_table end The controller is (edited for brevity): def show …
ghoppe
  • 21,452
  • 3
  • 30
  • 21
-1
votes
1 answer

will_paginate on array only displays first page of items

I need to paginate an array. When I click the other pages, I see the same 25 items as displayed on the first page. The URL is http://localhost:3000/?page=2 but it's the same 25 items. There are about 100 total. Here's my controller method: def…
helpmeplz
  • 151
  • 1
  • 3
  • 11
-1
votes
1 answer

Getting 500 internal server error with ajax/will_paginate in Rails

I've built a card slider where 20 cards are loaded on each page. I'm trying to have it so that when the user clicks on a button on the the last card (card with index 19), an AJAX call is made to render the next page and replace my original 20 cards…
saml
  • 5
  • 5
-1
votes
1 answer

undefined method `paginate' for #

im using rails 4 and will_paginate and friendly_id source 'https://rubygems.org' gem 'rails', '4.2.6' gem 'friendly_id', '~> 5.1.0' gem 'sorcery' gem "paperclip", "~> 4.3" gem 'will_paginate', '3.0.7' gem…
anouar
  • 125
  • 1
  • 1
  • 10
-1
votes
2 answers

using will_paginate for arrays only

I have a rails app where a user can enter keywords into a search box. From there, I find the id's of those matching keywords, then I do more processing until i arrive at an array of items that fulfill that criteria. EXAMPLE: A user searches for…
Matthew
  • 2,035
  • 4
  • 25
  • 48
-1
votes
1 answer

Remove 'page' option from will_paginate URL

I'm using rails and will_paginate gem. Is it possible to remove 'page' option from URL to other place - e.g. params (without ajax) ? For example instead www.site.com/products?page=2, always show www.site.com/products Thanks!
Extazystas
  • 488
  • 2
  • 11
-1
votes
1 answer

Pagination fails if some condition is checked in rails

Want to show the records satisfying some condition after retrieving it from the database in Ruby on rails. Problem is that : currently I am showing the records using will_paginate gem without checking the condition after retrieving it from…
Mohammad Sadiq Shaikh
  • 3,160
  • 9
  • 35
  • 54
-1
votes
2 answers

Wil Paignate : Previous link> 1 of 20 next link>

I like to display my paginate records like below formats Previous link> 1 of 20 next link> where 1 represent page 1 and 20 represent total number of pages. if I click on next then I like to display below format. Previous link> 2 of 20 next link> I…
1 2 3
57
58