Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

:page => :last

#116

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

show's last page by default :)

Useful for me :)

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

State: invalid
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Eugene Pimenov
    Eugene Pimenov
    • Title changed from [PATCH] :page => :last to :page => :last

    September 25th, 2007 @ 09:11 AM

  2. Chris Wanstrath
    Chris Wanstrath
    • Assigned user changed from Chris Wanstrath to Mislav
    • State changed from new to open

    September 25th, 2007 @ 09:22 AM

  3. Mislav
    Mislav
    • 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.

    September 26th, 2007 @ 10:57 PM

  4. Eugene Pimenov
    Eugene Pimenov

    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.

    September 26th, 2007 @ 11:32 PM

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.