if counter % 2 == 1 I am trying to decode this line - it\'s a Rails project and I am trying to figure out what the % does in this if statement.
if counter % 2 == 1
%
That's the modulo operator. It gives the remainder when counter is divided by 2.
For example: 3 % 2 == 1 2 % 2 == 0