Guest User

Untitled

a guest
Jun 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. ########Controller#######
  2. courses_152 = Course.find(:all, :conditions => "section LIKE 'CSC 152%'").collect { |course| course.class_id }
  3.  
  4. #I want to somehow sort through the @152pre array but not sure how to do it
  5. #in ruby?
  6. #@152pre = Course.find(:all, :conditions => "section LIKE 'CSC 152%'").collect { |course| course.class_id }
  7.  
  8.  
  9.  
  10. students_152_only = Grade.find(:all, :conditions => {:class_id => courses_152}).collect { |g| g.surrogate_id }
  11.  
  12.  
  13. ######dan2######
  14. <h1>How did CSC152 Students Compare C++ VS Java</h1>
  15. <h2>Post Java</h2>
  16. <table>
  17. <tr>
  18. <th>Grade</th><th>Count</th>
  19. </tr>
  20.  
  21. <% for grade in @grades_152_only %>
  22. <tr>
  23. <td><%= grade[0] %></td>
  24. <td><%= grade[1] %></td>
  25. </tr>
  26. <% end %>
  27. </table>
  28.  
  29. <h2>Pre java</h2>
Add Comment
Please, Sign In to add comment