title: Search Field for Table with Ruby on Rails
body: <p>I'm fairly new to Rails, but have an extensive Java/C++ background and am working on a project where I display a search box and a table using the following html:</p>
  
  <pre><code>&lt;h2&gt;Search ID&lt;/h2&gt;
    &lt;%= form_tag do %&gt;
    &lt;%= label_tag :user_id, "User ID" %&gt;
    &lt;%= text_field_tag :user_id %&gt;
    &lt;%= submit_tag "Search" %&gt;
    &lt;% end %&gt;
  &lt;h2&gt;List of People&lt;/h2&gt;
  &lt;div&gt;
    &lt;table id="people_list" class="tablesorter"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;User Name&lt;/th&gt;
        &lt;th&gt;ID Number&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
        &lt;% Users.each do |user| %&gt;
          &lt;tr&gt;&lt;td&gt;&lt;%= user.name %&gt;&lt;/td&gt;&lt;td&gt;&lt;%= user.id_number %&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;% end %&gt;
    &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What I want is a search box that will allow you to essentially "query" the table with a user_id and give back the user. Ideally I would like to do this without redirecting to a new page when the search button is pressed.</p>
  
  <p>Is it possible to dynamically show a row of the table underneath the search bar and above the table if a search is done? If so, how would I do this in the <code>html.erb</code> file? What method would the search button go to in my controller? I imagine it would be different than the method that my table uses to populate itself.</p>
  
  <p>Any help would be greatly appreciated. </p>