As much as I love rails, I’ve always hated dealing with dates in an html form…especially when the date isn’t an object’s property.
The select_date helper is nice, but it always generates this:
<select name="date[year]" id="date_year">
<select name="date[month]" id="date_month">
<select name="date[day]" id="date_day">
And I can’t figure out a way to change the name prefix from “date” to something else. Is there a way to do this? What do you all use for date inputs when they’re not an object property?
You can use the :prefix option to do this.
Which generates this:
More examples here
http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-select_date