<h1>Editing Group Grades</h1>

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

  <p>
    <%= f.label :groupnum %><br />
    <%= f.select :groupnum, 
    Student.find(:all, :select => "DISTINCT Students.groupnum", 
    :conditions => ["groupnum !=  ' ' "],
    :order => "groupnum").collect{|s| [s.groupnum, s.groupnum]} %>
  </p>
  <p>
    <%= f.label :assignment_id %><br />
    <%= f.select :assignment_id, 
    Assignment.find(:all,  :conditions => ["groupf =  't' "], 
    :order => "due_date").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', @ggrade %> |
<%= link_to 'Back', ggrades_path %>