I am trying to list dates of the month vertically, so far my table looks as followed:

I have today’s date however I need to list 18 days from today vertically. As well as generate the cells against these dates. From my index.html.erb I understand that I have the following @dates variable isn’t being set properly in my controller.
@datesvariable isn’t being set properly, if you add the statement
<%= debug @dates %> to your view you can inspect what it’s being
Controller: Gist – Controller.rb
Index: Gist – Index.html.erb
Model: Gist – Model.rb
I understand that I will need to change my controller’s index action so it is able to list 18 days from today. I was thinking of doing something somewhat similar.. – Time.now+18.days However I am not sure if something like this would solve my problems? As I’m not fully sure how to implement this into my controller. What is the best possible solution?
1 Answer