I use jquery_datepicker gem for selecting date in my form. However, datepicker passes param in the following format:
{"appointment"=>{"starts_at"=>"04/07/2012"}, "commit"=>"Submit", "id"=>"915"}
However, Rails requires that the date params must be in the following form:
"starts_at(1i)"=>"2012", "starts_at(2i)"=>"4", "starts_at(3i)"=>"7"
How should I parse my starts_at and get it back in the latter format?
The reason I need to manually parse it, because for some reason, rails confused 04/07/2012 as Jul 04, instead of April 07 (as jQuery datepicker displayed).
You can try to form date picker string at client side: