title: "Active" class not working in Bootstrap Navbar
body: <p>There is another question on this site that is the similar to this one, but unfortunately after trying all of the suggestions following that question, I still haven't found a solution.</p>
  
  <p>My Navbar is looking very basic at this point: </p>
  
  <pre><code>&lt;nav class="navbar navbar-inverse"&gt;
    &lt;div class="container-fluid"&gt;
      &lt;div class="navbar-header"&gt;
          &lt;a class="navbar-brand"&lt;%= link_to 'GoChat', root_path %&gt;&lt;/a&gt;
      &lt;/div&gt;
  
      &lt;ul class="nav navbar-nav"&gt;
          &lt;li class="nav-item"&gt;
              &lt;%= link_to 'New Comment', new_comment_path %&gt;&lt;/li&gt;
          &lt;li class="nav-item active"&gt;
              &lt;%= link_to 'View Comments', comments_path %&gt;&lt;/li&gt;
          &lt;li class="nav item"&gt;
              &lt;%= link_to 'Profile', user_path(current_user) %&gt;&lt;/li&gt;
       &lt;/ul&gt;     
    &lt;/div&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>Following the advice given on the question <a href="https://stackoverflow.com/questions/24514717/bootstrap-navbar-active-state-not-working">Bootstrap navbar Active State not working</a>, I tried adding the following code to my application js file, but this didn't work. I also tried using html links instead of the embedded Ruby links I'm currently using. </p>
  
  <pre><code>$(".nav-item").on("click", function(){
     $(".nav").find(".active").removeClass("active");
     $(this).parent().addClass("active");
  });
  </code></pre>
  
  <p>I also tried using the "nav a" tag in the jquery code, and even the "li" tag too but this didn't work.</p>
  
  <p>I'm not using the Bootstrap CDN - I downloaded the compressed and minified files to my app. I tried with the CDN also but to no effect.
  Other than that, I think the only thing to mention is that the following code is used in my application js: </p>
  
  <pre><code>//= require rails-ujs
  
  //= require jquery
  //= require jquery_ujs
  //= require turbolinks
  //= require bootstrap-sprockets
  //= require_tree .
  </code></pre>
  
  <p>and in application css:</p>
  
  <pre><code> *= require_tree .
   *= require_self
   *= require rails_bootstrap_forms
  </code></pre>
  
  <p>I don't have any idea of what to try next so I would really appreciate some help on this one, thanks :-)</p>