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.

will_paginate for single models

#9

I was trying to use this plugin and it seems like it was written for associated models (:board has_many :posts)

How should I write my controller code for cases when there is no parent model? Is this even possible?

Reported by Steven Garcia · May 10th, 2007 @ 01:53 AM

State: invalid
Milestone: none
Assigned to: PJ Hyett PJ Hyett

Activity

  1. PJ Hyett
    PJ Hyett
    • State changed from new to open

    You're free to use this with any object or association.

    All you need is a subset of objects and a total count of all of those objects that fit your criteria to use this plugin. There's a lot of functionality given automatically, but you're free to override most of it.

    If that sounds like a vague answer, perhaps you could post some code to let me know what you're trying to do.

    May 10th, 2007 @ 01:53 AM

  2. Mislav
    Mislav
    • State changed from open to invalid

    It's clear to me that Steven didn't understand that "paginate" methods is just a wrapper (kinda) for "find", so they can do anything "find" can.

    Anyway, [203]:http://require.errtheblog.com/plugins/changeset/203 adds many finder tests to the plugin which pass in the most simple and complex scenarios. I'm closing this because the finder doesn't have to operate on associated models.

    May 10th, 2007 @ 01:53 AM

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.