<h1>Editing Individual Grade</h1>
<h2>(Update assignment and/or grade)</h2>

<% form_for(@igrade) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :student_id, 'Student ID' %><br />
    <%= f.text_field :student_id, :disabled => "disabled"  %>
  </p>
  <% student = @igrade.student_id%>
  <p>
  <b><%= f.label  :name, 'Student Name' %></b><br />
	<%= Student.find(:all, :select => "students.name", 
	    :conditions => "id = #{@igrade.student_id} " ).collect{|s| s.name} %>
  </p>	
  <p>
    <%= f.label :assignment_id, 'Assignment' %><br />
    <%= f.select :assignment_id, 
    Assignment.find(:all,  :conditions => 
    ["groupf =  'f' "]).collect{|s| [s.description, s.id]} %>
  </p>
  <p>
    <%= f.label :grade %><br />
    <%= f.text_field :grade %>
  </p>
  <p>
    <%= f.submit 'Update' %>
  </p>
<% end %>

<%= link_to 'Show', @igrade %> |
<%= link_to 'Back', igrades_path %>