title: What is the rails way of using link_to to change an instance variable and what is being paginated in a view?
body: <p>Photos Controller</p>
  
  <pre><code>@photos = Photo.all.paginate(page: params[:page], per_page: 9)
  </code></pre>
  
  <p>I want my view as follows along the top:</p>
  
  <p>[Today] [Yesterday] [This Week] [Last Week] [Popular] </p>
  
  <pre><code>&lt;% @photos.in_groups_of(6, false).each do |group| %&gt; 
    &lt;% group.each do |photo| %&gt;
       &lt;%= image_tag photo.thumb.url %&gt;
       &lt;%= photo.title %&gt; 
    &lt;% end %&gt;
  &lt;% end %&gt;  
  </code></pre>
  
  <p>and when the link_to yesterday is clicked, i want to substitute the following instance variable for @photos in the view: </p>
  
  <pre><code> @photos_yesterday = Photo.where("DATE(created_at) = DATE(?)", 1.day.ago).paginate(page: params[:page], per_page: 9)
  </code></pre>