Paginate and 'Group By' Option

use the paginating_find plugin (read about it on http://cardboardrocket.com).
That being said, the count will be wrong so you will need to hack the find
method to help it figure out how many pages are in the collection. Here's
the hack:

Find the code in paginating_find.rb that says:

total_size = limit ? limit : count(options[:conditions], options[:joins])

Replace it with:

        if block_given?
          total_size = limit ? limit : yield
        else
          total_size = limit ? limit : count(options[:conditions],
options[:joins])
        end

Now, when you call find, do it as:

@my_fine_stuff = Model.find(:all, ...whateveroptionsyouhave...) { whatever
it takes to count the records in the collection }

It's not too economical of SQL queries but it works.

Bryan Roxah wrote: