I hope this is not too much of a newbie question. I have been looking for posts and haven't found anything yet, so I thought I would try the forum for the first time.
I am a developer at a school district creating a Rails app for scheduling some Intervention classes. I am trying to create a drop-down list of students who are not yet enrolled by subtracting an array of enrolled student numbers from an array of all student numbers. Something like this:
available_students = all_students - enrolled_students
I am getting all_students as the result, and I am assuming it is because the arrays are of different types. The all_students array looks like this in the console:
[#<Student student_number: 99754.0>, #<Student student_number: 91758.0>, #<Student student_number: 92757.0> . . .]
while the enrolled_students came from a different table and looks like this in the console:
[#<Enrollment student_number: 99754.0>,#<Enrollment student_number: 99754.0>,#<Enrollment student_number: 99754.0>. . .]
I am thinking that I need to convert these into simple arrays so I can subtract one from the other, but I haven't found how to do that.
I would really appreciate your help letting me know if I am on the right track and how this can be done.