Forum: Ruby on Rails Doozy of a pagination problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Joe P. (Guest)
on 2008-12-15 17:19

This is sort of complicated, and I'm trying to keep it as simple as I

I'm using will_paginate to display only 25 snapshots on each page.  My
question is how can I return only the most recent snapshot per link
(just one per link)?

@snapshots = Snapshot.paginate :order => 'snapshots.weighted_score
desc', :conditions => ["snapshots.scenario_id = ? and (links.status = 1
or links.status = 2 or links.status = 4)",], :include =>
[:page, :link, {:snapshot_attributes => :attribute}], :page =>
params[:page], :per_page => 25

Let me know if any other information is needed, and thanks for any
This topic is locked and can not be replied to.