I am working on a ruby on rails project. In my controller I have an array and I need to copy all the from this array to another except the ones that does not pass the condition.
For example i have an array
a = [1,2,3,4,5]
i will take an input from the user. if the user's input is 3 then it has to copy all other elements from the array 'A' to array 'B' except 3. The array B has to be this [1,2,4,5]
How do i do this?
Aucun commentaire:
Enregistrer un commentaire