<div class="pull-right">
  <%= form_tag admin_profiles_path, method: :get, class: "search-query form-inline pull-right" do %>
    <%= text_field_tag :query, params[:query], class: "input-medium search-query" %>
    <%= select_tag :first_program, options_from_collection_for_select(FirstProgram.all, :code, :abbr, params[:first_program]), prompt: 'All', class: 'input-small' %>
    <%= submit_tag :search, class: "btn" %>
  <% end %>
  <p>
    Download: 
    <%= link_to "CSV", admin_profiles_path(format: :csv) %> |
    <%= link_to "Excel", admin_profiles_path(format: :xls) %>
  </p>
</div>

<h1>Profiles</h1>

<table class="table">
  <tr>
    <th>Name</th>
    <th>Email</th>
  </tr>
  <%= render @profiles %>
</table>

<div class="pull-right">
  <%= form_tag admin_profiles_path, method: :get, class: "search-query form-inline pull-right" do %>
    <%= text_field_tag :query, params[:query], class: "input-medium search-query" %>
    <%= select_tag :first_program, options_from_collection_for_select(FirstProgram.all, :code, :abbr, params[:first_program]), prompt: 'All', class: 'input-small' %>
    <%= submit_tag :search, class: "btn" %>
  <% end %>
  <p>
    Download: 
    <%= link_to "CSV", admin_profiles_path(format: :csv, first_program: params[:first_program], query: params[:query]) %> |
    <%= link_to "Excel", admin_profiles_path(format: :xls, first_program: params[:first_program], query: params[:query]) %>
  </p>
</div>

<h1>Profiles</h1>

<table class="table">
  <tr>
    <th>Name</th>
    <th>Email</th>
  </tr>
  <%= render @profiles %>
</table>

Make sure csv/xls downloads include search filters
Make sure csv/xls downloads include search filters
