I had to make a selector for the date. I needed a selector for the month, day and year.

Instead of writing 30 times:

<label for="date">Date</label>
  <select>
   <option>1</option>
   <option>2</option>
   <option>3</option>
  </select>
</label>

I can’t write the code in this template because I’didn’t find the form to write Ruby in a templete with markdown without executing the code. I guess for my next post and I’ll have the way to go, as it is not critical to my application.

You can do the following for the month:

To write in Ruby with mote you always need to write %.
Now you write:

Here we are giving a method each.
I’m saying:
You should start at number 1 to 12.
The default date must be today place: Time.now.month.

The same applies for days:

You should start at number 1 and finish in 12. The default date must be today place: Time.now.day (I’m change month for day)

And the year:

Here what we are saying is:
The default date must be today place: Time.now.year.
After we are asking me to put in less than two years selector year in which we are.

With this code I can now create forms without having to manually type all options.