title: How to add a number to the date ruby
body: <p>I have method:</p>
  
  <pre><code>def date_of_next()
   date = Date.parse('Monday')
   delta = date &gt; Date.today ? 0 : 7
   date + delta
   return date.strftime('%Y-%w-%d'), (date + 7).strftime('%Y-%w-%d')
  end
  </code></pre>
  
  <p>This method specifies the date of Monday this week.
  In return, I also return the date of Monday next week, but it does not display the date that needs to be</p>
  
  <p>if I run this method in the .rb file then it prints everything well</p>
  
  <pre><code> 2019-01-28
   2019-02-4
  </code></pre>
  
  <p>but if run this method in rails controller, there is a problem with the date</p>
  
  <pre><code>2019-01-28
  2019-01-04
  </code></pre>
  
  <p>As you see, there is a problem with the date of the month.
  I do not understand what the problem is, help</p>