title: Rails search form doesn't work if page has another form
body: <p>I have a search form in my navbar, so it's on all pages of the application. If i go to a page that has a form like the user's edit page or create a new post page the search doesn't work. How come?? How can i fix this??</p>
  
  <p><Strong>EDIT (read comments)</strong></p>
  
  <pre><code>// Make sure search form isn't blank
  $("form.navbar-search").submit(function(){
      var isFormValid = true;
  
      $("input").each(function(){
          if ($.trim($(this).val()).length == 0){
              isFormValid = false;
          }
          else{
              $(this).removeClass("highlight");
          }
      });
  
      return isFormValid;
  });
  </code></pre>