In my view I have two instance variables (going to be more) that I want to display in one table. The first, @data, is an instance var of a model, someting like @data=RnFile.all.
The second is an array @result containing a value per data in @data calculated in the controller. Now in my view I want to display them next to each other, something like:
@data[0].atributes @result[0]
@data[1].atributes @result[1]
@data[2].atributes @result[2]
@data[3].atributes @result[3]
...
but I can’t figure out how to iterate over both the arrays (and propably more to come).
Any suggestions anyone? Thanks
You can use Array#zip to do what you want: