Does Ruby/Rails have a ++ equivalent?
x+=1
is the best you can do in Ruby.
For a detailed explanation, see Why doesn't Ruby support i++ or i-- (increment/decrement operators)?
Try this:
x += 1
x+=1
is the best you can do in Ruby.
For a detailed explanation, see Why doesn't Ruby support i++ or i-- (increment/decrement operators)?
Try this:
x += 1