Functions like select_day, select_month, or select_year by defaults have
a field name of “date[day]”, “date[month]”, and “date[year]”
respectively. Well, I want to change it to be as simply as “day”,
“month”, and “year”. Do rails have a built in function to do that?
In the documentation, I found a :field_name option, but it does not meet
my need (the format is still “date[field_name]”).
Functions like select_day, select_month, or select_year by defaults have
a field name of “date[day]”, “date[month]”, and “date[year]”
respectively. Well, I want to change it to be as simply as “day”,
“month”, and “year”. Do rails have a built in function to do that?
In the documentation, I found a :field_name option, but it does not meet
my need (the format is still “date[field_name]”).
Rails does that so it can reconstitute them into a date attribute
properly.
If you really want three separate parameters then why not just use
regular select_tag helpers and give them whatever names you want, rather
than fiddling with overriding the behavior of the date_select helpers.
Rails does that so it can reconstitute them into a date attribute
properly.
If you really want three separate parameters then why not just use
regular select_tag helpers and give them whatever names you want, rather
than fiddling with overriding the behavior of the date_select helpers.
That’s OK. I just want to make sure if that functionality is available.
Thanks!