How to use collect and include for multidimensional array in Ruby on Rails : I have code that currently checks the multidimensional array and if the array includes student id replace the element with 'X'. 

When I tested it with single input. For example, `@student_ids` is only `1` then it works but if `@student_ids` has more then one elements such as `1,2,3`, it makes errors.

What I am trying to implement is if the `array1` includes elements that are @student_ids, I want to replace them with `X`.


Any help?

     
    array1 = [[1,2,3,4,5]+[7,8,9,10]+[11,12,13,14]]
    @student_ids = 1,2,3 

    array1.collect! do |i| 
      if i.include?(@student_ids) #
        i[i.index(@student_ids)] = 'X'; i # I want to replace all with X
      else
        i
      end
    end
    

so I want to see [[X,X,X,4,5]+[7,8,9,10]+[11,12,13,14]] like this. 

