title: how to paginate combined with anchor id
body: <p>I'm very new to Ruby on Rails and learning while trying to fix some bugs on my company website. I'm trying to paginate a collection of records combined with a particular anchor, i.e. when user clicks on the next/previous page, the pagination happens and user lands on a particular section of the page. This is how my code looks at the moment:</p>
  
  <h2>view</h2>
  
  <pre><code>&lt;%= page_navigation_links @student_logs, :page %&gt;&lt;/p&gt;
  </code></pre>
  
  <h2>controller:</h2>
  
  <pre><code>@student_logs.paginate(:page =&gt; params[:page], :per_page =&gt; 10)
  </code></pre>
  
  <h2>application_helper</h2>
  
  <pre><code>def page_navigation_links(pages, param_name=:page)
  
    will_paginate(pages, :class =&gt; 'pagination', :inner_window =&gt; 2, :outer_window =&gt; 0, :renderer =&gt; BootstrapHelper::LinkRenderer, :previous_label =&gt; '&amp;larr;'.html_safe, :next_label =&gt; '&amp;rarr;'.html_safe, :param_name =&gt; param_name)
  
  end
  </code></pre>
  
  <p>This works fine for my pagination, but I need to fit a reference to an 'anchor id' into this code, like Student Logs, so that when user navigates to a different page the browser navigates the user to the heading with id: "student_logs".</p>
  
  <p>I can't figure out how to do this. Can anyone help?</p>