title: Changing Current Tab in Rails
body: <p>I have a list of tabs at the top of my application that I include in a general layout in application.html.erb.  They look like this:</p>
  
  <pre><code>&lt;li class="current"&gt;&lt;%= link_to "Home", provider_path(current_user.id), :method=&gt; "GET"%&gt; &lt;/li&gt;
              &lt;li&gt;&lt;%= link_to "Edit Profile", edit_student_path(current_user.id) %&gt; &lt;/li&gt;
              &lt;li&gt;&lt;%= link_to "Search", provider_search_path %&gt; &lt;/li&gt;
  </code></pre>
  
  <p>I want to change the selected tab to the "current" one, when I hit that page.  So when I click Edit Profile and the Edit Profile page loads, the tabs should appear as follows:</p>
  
  <pre><code>&lt;li&gt;&lt;%= link_to "Home", provider_path(current_user.id), :method=&gt; "GET"%&gt; &lt;/li&gt;
   &lt;li class="current"&gt;&lt;%= link_to "Edit Profile", edit_student_path(current_user.id) %&gt; &lt;/li&gt;
    &lt;li&gt;&lt;%= link_to "Search", provider_search_path %&gt; &lt;/li&gt;
  </code></pre>
  
  <p>Is there a way to do this outside of adding javascript to the page which is displayed?  Or if there is what is generally best practice for doing this in the DRYest way possible.</p>
  
  <p>Thanks</p>