How can I subtract a variable from a date in Ruby on Rails,
I want to subtract a variable, which can contain any value between 1 and 7, which represent the days, at a specific date.
in algorithm it would be something like this:
días = 5 fecha = 20170602 fecha_resultado = fecha - días
date_result would have the value of: