I want to generate 5 buttons with different values based on one integer. For example I've got 30, I want to create buttons with 10 20 30 40 50
value = 30
int1 = value - 20
int2 = value - 10
int3 = value
int4 = value + 10
int5 = value + 20
buttoncode = ""
%w{int1 int2 int3 int4 int5}.each do |minutes|
buttoncode += 'buttoncode'
end
I can do it in a very bad way, but it could be done a smarter solution I guess. Is it possible to make something like that?
%w{sum(max-20) sum(max-10) max sum(max+10) sum(max+20)}.each do |minutes|
end