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
12
votes
4 answers

How to paginate Rabl's collections

I have this template: # app/views/posts/index.rabl collection @posts => :posts attributes :id, :title, :subject child(:user) { attributes :full_name } node(:read) { |post| post.read_by?(@user) } Witch returns: { "posts": [ { …
Zag zag..
  • 6,041
  • 6
  • 27
  • 36
12
votes
2 answers

Rails3: How to pass param into custom will_paginate renderer?

I've got a custom will_paginate renderer that overrides WillPaginate::ViewHelpers::LinkRenderer's link method like so: def link(text, target, attributes = {}) "
yalestar
  • 9,334
  • 6
  • 39
  • 52
11
votes
4 answers

custom will_paginate renderer

Documentation is lacking for will_paginate custom renderers: There is no documentation how to write your own link renderer, but the source code is pretty self-explanatory. Dive into it, and selectively override methods of the LinkRenderer to adjust…
Blair Anderson
  • 19,463
  • 8
  • 77
  • 114
10
votes
1 answer

will_paginate -> How to change the default url?

will_paginate plugin aways generates the pagination to the current url appending the page parameter. Is there a way to change this? I need it to paginate to another controller/action plus some arguments.
Tiago
  • 2,966
  • 4
  • 33
  • 41
10
votes
1 answer

Deprecation warning: #apply_finder_options

I get DEPRECATION WARNING: #apply_finder_options is deprecated. when trying this in my user.rb: def User.search(search, page) paginate page: page, per_page: 10, conditions: ['name LIKE ?', "%#{search}%"], order:…
9
votes
2 answers

How best to DRY will_paginate options

I have 8 controllers using will_paginate to paginate their index pages. I'd like to override the defaults for "Previous" and "Next" on each without having to specify the same options 8 times. Is there a way to override the defaults only once…
Jack R-G
  • 1,778
  • 2
  • 19
  • 25
9
votes
1 answer

Rails 3 and will_paginate - elegant way, how to get total_pages

I am working with will_paginate plugin in Rails 3 and I am trying to get to some variable the count of pages (total_pages). I thought the total pages is in globally variable @total_pages, or in @option[:total_pages]**, but if I will use this…
user1946705
  • 2,858
  • 14
  • 41
  • 58
9
votes
2 answers

Change number of elements per page with <%= will_paginate %>

I'm using the will_paginate gem. The default is 30 elements per page. How do I customize this?
Justin Meltzer
  • 13,318
  • 32
  • 117
  • 182
9
votes
2 answers

How can I localize will_paginate in ruby on rails?

I like to localize the "previous" and "next" links in will_paginate, how can I do that? Did anyone find a nice workaround?
tabaluga
  • 1,377
  • 4
  • 20
  • 27
9
votes
3 answers

Will Paginate Rails 3 Per Page

I am trying to limit the number of elements returned with mislav's will paginate with Rails 3. I am currently using: # Gemfile gem 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git', :branch => 'rails3' # company.rb class Company…
Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232
9
votes
3 answers

Rails will_paginate custom route

How can I use will_paginate with a custom route? I have the following in my routes: map.connect 'human-readable/:name', :controller => :tags, :action => 'show' but will_paginate uses url_for as far as I can tell, but I want to use 'human-readable'…
kristian nissen
  • 2,809
  • 5
  • 44
  • 68
9
votes
4 answers

Undefined method `paginate'

I'm trying to use the will_paginate gem but something's wrong. I'm stuck with an undefined method `paginate' error. I read many issues and try a lot of things. Here's what I've got : This is my LocationsController.rb: def index @locations =…
user2462805
  • 1,049
  • 3
  • 11
  • 26
9
votes
1 answer

Pagination in Clojure

Is there anything equivalent to will_paginate for noir/hiccup? How do people usually paginate with noir/hiccup? Thank you
Pedro Rolo
  • 28,273
  • 12
  • 60
  • 94
9
votes
4 answers

Using will_paginate with multiple models (Rails)

Pretty sure that I'm missing something really simple here: I'm trying to display a series of pages that contain instances of two different models - Profiles and Groups. I need them ordering by their name attribute. I could select all of the…
Codebeef
  • 43,508
  • 23
  • 86
  • 119
8
votes
4 answers

Trouble with will_paginate method

I'm trying to paginate with will_paginate in my rails app. I'm following the rails Tutorial by Michael Hartl. In my controller I have def index @users = User.paginate(page: params[:page]) end In my view I have <%= will_paginate %>
Abhishek Sharma
  • 617
  • 1
  • 9
  • 17
1
2
3
57 58