Sort 12 Discussions, By:
Please Login in order to post a comment
this is the exact answer:
array.each do |user|
What is the significance of |user|?
That binds each element of the list to the variable name user. Here is some equivalent code, in a less "Ruby" style.
i = 0
while i < array.size
user = array[i]
# do stuff
i += 1
Ah I see, thank you for clarifying!
thanks that did work
Can we see the source code for User? As well as how the array is defined/populated initially?
Without it, it's just another blind "copy and paste, have blind faith that everything works as expected" problem.