@sco_array = [#<ExaminationScore:0x10051fe0 @attributes={"student_id"=>"1951", "subject_id"=>"3", "student_name"=>"qqq", "subject_title"=>"英语", "student_code"=>"3101012001320100119", "score"=>"0", "clazz_name"=>"高三(10)班"}>]
想得到 title 是英文的分数,用学生 id 做键,分数做值,怎么实现?
@scores.collect { |s| s.subject_title == '英语' }
请教各位