title: Rails random ActiveRecord while paginating
body: <p>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:</p>
  
  <pre><code>def index
    @photos = Photo.order('random()').paginate(:per_page =&gt; 12, :page =&gt; params[:page])
  end
  </code></pre>
  
  <p>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?</p>