will_paginate
will_paginate copied to clipboard
Pagination library for Rails and other Ruby applications
With per_page set to 10; First page will retrieve 1~10, Second page will retrieve 10~20 (instead of 11 to 20). This results in repeating edge rows between pages. Rails 3.2.0...
Trivial example: ``` class Person < < ActiveRecord::Base scope :paged, lambda { |p| page(p) } end ``` Now: ``` irb(main):002:0> Person.paged(1).current_page => nil irb(main):003:0> Person.page(1).current_page => page 1 ``` #...
Trying to paginate an activerecord set of records from a table, using: @newBookings = Booking.paginate_by_sql Booking._SQL_FOR_NEW, :page => pageNew, :order => 'create_date DESC' and being Booking._SQL_FOR_NEW = ['select \* from...
The code in question is model_count = collection.total_pages > 1 ? 5 : collection.size I can not catch the idea of setting model_count to five for multypage case, but it...
I have a model Page with a number of column one of which is a column containing very big entry Therefore i want to specify the select clause in order...
I haven't been able to figure out exactly why, but I've found that this code: ``` ruby rv = AssetPrice. includes([:currency, :pricing_source,{:asset_listing => :listing_ids}]). where(['AssetPrice.asOfDate = ? AND ListingId.listingIdSourceId =...
will_paginate 3.0.pre2 provided previous_page and next_page methods on the object returned from .paginate(:page => params[:page]). These were useful to check if I wanted to alter other parts of the view...
It would be nice to allow a way to handle out of bounds paging in a consistent way. Right now it's up to the calling code to call #out_of_bounds? and...
I am running will_paginate 3.0.pre2 on rails 3.0.7, and there seems to be some type of strange bug where a EagerLoadPolymorphicError is being raised whenever almost any conditions are used....
Hi, I've got something like this in my routes.rb namespace :somewhere, :path => "/somewhere/:somewhere_id" do resources :posts end and in a view I call the will_paginate like always and it...