Using the output of date_select
Tuesday, August 28th, 2007Hmmm, after lots of time spent writing things like
item = Item.new
item.date = "#{params[:item]['date(1i)']}-#{params[:item]['date(2i)']}-#{params[:item]['date(3i)']}"
I’ve accidentally found out that Item.new(params[:item]) is clever enough to see these 3 parameters, know that they’re from a date_select, and combine them to form a date.
The Rails API for the date_select method specifies this now. I’m fairly sure it didn’t a while back…