In the application that I am developing, I have a date switch that will be used mainly with the current date as a value (or a date in a few days). To reduce the work for my users, I want to set today's date as the default.
I can easily set the year:
date_select f, :date, class="form_control", year: [options: @current_year, @current_year+1]
but they could not do something like that for a month and a day.
I tried changing the code to date_select f, :date, class="form_control", year: [options: @current_year, @current_year+1], month: [default: 2],
date_select f, :date, class="form_control", year: [options: @current_year, @current_year+1], month: [default: "2"]
date_select f, :date, class="form_control", year: [options: @current_year, @current_year+1], month: [default: "02"]
but none of them worked. Replacing defaultwith valuedid not matter. What mistake am I making?
Thanks in advance
source
share