app/views/users/_result_list.html.erb
<center><strong>LDAP Search Results</strong></center>
<table class = "tablesorter">
<thead>
<tr>
<th>Login</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Add</th >
</tr>
<tr id="loading_row">
<td colspan="5">
<center><%= image_tag("loading.gif", :align=>:center, class: "loading_icon") %>Searching...</center>
</td>
</tr>
</thead>
<% if @results && !@results.empty? %>
<% @results.each do |result| %>
<tbody>
<tr>
<td><%= result[:login] %></td>
<td><%= result[:first_name] %></td>
<td><%= result[:last_name] %></td>
<td><%= result[:email] %></td>
<td><%= button_to_remote "Add Me!", :url=> {action: "fill_form", params: {:user=>result}}%></td>
</tr>
</tbody>
<% end %>
<% elsif @results && @results.empty? %>
<tr class="result">
<td colspan="5">
<strong>No results related to the information you have entered were found.</strong>
</td>
</tr>
<% else %>
<tr>
<td colspan="5">
<strong>Oops! Something went wrong. Please try again, or talk to your application administrator if you continue to experience problems.</strong>
</td>
</tr>
<% end %>
</table>