Ajax与Rails

A little new to the Ajax part of this so please bear with me. Let's say I have a view like as follows:

<button class="button">Filter by location</button>
<button class="button">Filter by time</button>

<table>
<thead>
<tr>
  <th>Type</th>
  <th>Location</th>
  <th>Meeting Days</th>
  <th>Start Time</th>
  <th>Stop Time</th>
</tr>

<% @courses.each do |course| %>
  <% if course.lec_exam.eql?("LEC")%>
  <tr>
    <td><%= course.lec_exam %></td>
    <td><%= course.location %></td>
    <td><%= course.meeting_days %></td>
    <td><%= course.begin_time %></td>
    <td><%= course.end_time %></td>
  </tr>
  <% end %>
<% end %>

I'd like to be able to apply filters using Ajax so the user can customize the current view. For example, if the user hits a "Filter by location" button, then I'd like the view to refresh and display all pertinent information that matches the location given as input. Some initial research hasn't really helped so any pointers would be great. I can post the controller info if that is needed. Thanks!