app/views/manager/index.erb
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/CSS/general.css">
</head>
<title>Manager Home</title>
<h1><%= @message %></h1>
<% if current_user %>
<% link_to('Logout', destroy_user_session_path, :method => :delete) %>
<% end %>
<% if flash[:error] %>
<div class = "alert alert-danger"><%= flash[:error] %></div>
<% end %>
<% if flash[:notice] %>
<div class = "alert alert-succuess"><%= flash[:notice] %></div>
<% end %>
<h2>Registered Student Applications</h2>
<div id = "body" >
<div class = "form">
<!--<div class="form-group">-->
<%=form_tag manager_index_path, class: "form-inline", method: :get do %>
<%= text_field_tag :query, params[:query], {:class => "form-control", :placeholder => "Search"} %>
<%= submit_tag "Search", class: "btn btn-primary" %>
<% if params[:query].present? %>
<%= link_to "clear", manager_index_path%>
<% end %>
<!--</div>-->
<% end %>
</div>
<br></br>
<div class = "container">
<table class="table">
<thead class="thead">
<tr>
<th>#</th>
<th><%= link_to 'First Name', manager_index_path(:sort => 'first_name', :query => params[:query])%></th>
<th><%= link_to 'Last Name', manager_index_path(:sort => 'last_name', :query => params[:query])%></th>
<th><%= link_to 'Email', manager_index_path(:sort => 'email')%></th>
<th>Gender</th>
<th>Country</th>
<th>Country_Code</th>
<th>Phone_Number</th>
<th>Program</th>
<th>Birthday</th>
<th>Details</th>
</tr>
</thead>
<% count = 1 %>
<% @students.each do |student| %>
<tbody>
<tr>
<th scope="row"><%= count%></td>
<td><%= student.first_name%></td>
<td><%= student.last_name %></td>
<td><%= student.email %></td>
<td><%= student.gender %></td>
<td><%= student.country %></td>
<td><%= student.country_code %></td>
<td><%= student.phone_number %></td>
<td><%= student.program %></td>
<td><%= student.dateOfBirth %></td>
<td><%= link_to "Details for #{student.first_name}", manager_path(student)%></td>
<% count += 1 %>
<%end%>
</tr>
</tbody>
</table>
<span class="nowrap_left"><%= link_to "Create New Application", new_manager_path %> </span>
<span class="nowrap_righ"><%= link_to "Download CSV", manager_index_path(format: "csv") %></span>
</div>
</div>
</html>