<h1>Listing Individual Grades</h1>

<table border="1">
  <tr>
    <th>Student ID</th>
    <th>Student Name</th>
    <th>Assignment ID</th>
    <th>Assignment Description</th>
    <th>Grade</th>
  </tr>

<% @igrades.each do |igrade| %>
  <tr>
    <td><%=h igrade.student_id %></td>
    <td><%=h Student.find(:all, :select => "students.name", 
        :conditions => "id = #{igrade.student_id} " ).collect{|s| s.name} %></td>
    <td><%=h igrade.assignment_id %></td>
    <td><%=h Assignment.find(:all, :select => "assignments.description", :order => "id",
        :conditions => "id = #{igrade.assignment_id} " ).collect{|s| s.description} %></td>
    <td><%=h igrade.grade %></td>
    <td><%= link_to 'Show', igrade %></td>
    <td><%= link_to 'Edit', edit_igrade_path(igrade) %></td>
    <td><%= link_to 'Destroy', igrade, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New igrade', new_igrade_path %>