#116 ✓invalid
Eugene Pimenov

:page => :last

Reported by Eugene Pimenov | September 25th, 2007 @ 09:09 AM

Mode.paginate :page => (params[:page] || :last), :default_page => :last

show's last page by default :)

Useful for me :)

Comments and changes to this ticket

  • Eugene Pimenov

    Eugene Pimenov September 25th, 2007 @ 09:11 AM

    • Title changed from “[PATCH] :page => :last” to “:page => :last”
  • Chris Wanstrath

    Chris Wanstrath September 25th, 2007 @ 09:22 AM

    • Assigned user changed from “Chris Wanstrath” to “Mislav”
    • State changed from “new” to “open”
  • Mislav

    Mislav September 26th, 2007 @ 10:57 PM

    • State changed from “open” to “invalid”

    Hi Eugene,

    I don't like adding another option, it gets too cluttered. What I do is this:

    User.paginate :page => params[:page], :order => 'updated_at DESC'

    By default it would paginate users from first to last, but now I'm paginating the other way -- from last updated to first. Pagination still starts from page 1 because that is the common pattern for pagination and I'm not going to break it.

    Thanks for the suggestion.

  • Eugene Pimenov

    Eugene Pimenov September 26th, 2007 @ 11:32 PM

    I understand about order :), but it reverses all entries.

    I just needed last page by default.

    Thanks for review anyway. I'll still use my version in this project =)

    Thanks for beautiful plugin.

    BTW if you don't use :default_page => :last default will be 1 in the my patch. I needed last page in only one place.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Everyone's favorite Ruby library for pagination of practically anything!

People watching this ticket