I am creating a class report — a two-dimensional table that shows the names of the lessons going horizontally and the list of students going vertically.
Student Name | LessonID x | LessonID x | LessonID x Joe 95% 95% Mary 80% 80% Sam 80% 80%
My data is in a table with these fields:
student_id, lesson_id, grade_in_pct, grade_in_pts, grade_high, grade_low, grade_median
The total number of students and lessons is not fixed.
I considered using the ruport / actions_as_reportable procedure or mysql pivot procedure, however it seems that the axis collapses only one dimension. In order not to work, because, in my opinion, I want to add mouse functions and conditional formatting to show more information about each class.
So, I think my only option is to create a nested hash and then scroll it in the view. What do you think? Can anyone suggest a way to create a nested hash? Would it be too processor intensive to go through 250 lines (~ 50 students, 5 lessons each)?
I am stuck. Please help. Thanks!
arrays ruby-on-rails hash pivot
Alex
source share