<h2>Results:</h2>

<% @users.each do |user| %>
<div class="result">
  <label>Name:</label> <%= user.prefix %> <%= user.first_name %> <%= user.last_name %><br>
  <label>Years of Experience: </label> <%= user.years %><br>
  <label>Licenses Held:</label> <%= user.licenses.map do |lic| lic.name end.join(', ') %><br>
  <label>Registered for Job Fair:</label> <% if user.register != "bank" %>Yes<% else %>No<%end%><br>
  <label>Location Preference:</label> <%= user.location_pref %><br>
  <label><a href="/users/<%= user.id %>">Profile</a></label><br>
</div>
<% end %>

<% if User.find(session[:user_id]).access == "admin" %>
  <%= form_tag(users_search_path(params.merge(format: 'csv'))) do %>
  <%= submit_tag 'Export to CSV', class: "btn btn-info"%>
  <% end %>
<% end %>
<h2>Results:</h2>

<% @users.each do |user| %>
<div class="result">
  <label>Name:</label> <%= user.prefix %> <%= user.first_name %> <%= user.last_name %><br>
  <label>Years of Experience: </label> <%= user.years %><br>
  <label>Licenses Held:</label> <%= user.licenses.map do |lic| lic.name end.join(', ') %><br>
  <label>Registered for Job Fair:</label> <% if user.register != "bank" %>Yes<% else %>No<%end%><br>
  <label>Location Preference:</label> <%= user.location_pref %><br>
  <label><a href="/users/<%= user.id %>">Profile</a></label><br>
</div>
<% end %>

<% if User.find(session[:user_id]).access == "admin" || User.find(session[:user_id]).access == "school"%>
  <%= form_tag(users_search_path(params.merge(format: 'csv'))) do %>
  <%= submit_tag 'Export to CSV', class: "btn btn-info export"%>
  <% end %>
<% end %>
Make export to csv available to schools
Make export to csv available to schools
