YaleSTC/shifts

View on GitHub
app/views/user_profile_entries/index.html.erb

Summary

Maintainability
Test Coverage
<% title "User Profile Entries" %>

<% @user_profile_fields.each do |profile_field| %>
    <h2><%= link_to "#{profile_field.name}", profile_field.name %></h2>
      <table class = "tablesorter">
     <thead>
    <tr>
      <th>User</th>
      <th>Contents</th>
    </tr>
     </thead>
    <% UserProfileEntry.where(user_profile_field_id: profile_field.id).each do |profile_entry| %>
    <tbody>
    <tr>
        <td><%= User.find(profile_entry.user_id).proper_name %>
        <td><%= profile_entry.content %>
      </tr>
     </tbody>
    <% end %>
  </table><br />
<% end %>
<p><%= link_to "New User Profile Entry", new_user_profile_entry_path %></p>