I am trying to display a series of photos in random order while paginating them. Trouble is, on each page of the pagination the random array is regenerated; so a user can see photos on page 2 that he's already seen on page 1. Lame. Here's my controller:
def index
@photos = Photo.order('random()').paginate(:per_page => 12, :page => params[:page])
end
I've been thinking it for a while and can't think of any reasonable solution. Is this easily doable? It seems like a pretty common function, but I may just have to ditch the random thing. Thoughts?