Using interpolated strings is it possible to call multiple #{} within each other?
For example I want to create a variable and add a number onto the end. I also want to attach a result from a column in site, but also increment the number as well. What the best method of doing the below code?
@site.each do |site|
1.upto(4) do |i|
eval("@var#{i} = #{site.site_#{i}_location}", b)
end
end
So @var1 = site.site_1_location, @var2 = site.site_2_location, etc.