SyntaxFix
Write A Post
Hire A Developer
Questions
In Ruby 2.1, each_with_index method is removed. Instead you can use each_index
Example:
a = [ "a", "b", "c" ] a.each_index {|x| print x, " -- " }
produces:
0 -- 1 -- 2 --