I am dynamically updating the underlying model by passing the parameters from the posted form to the model like this:
@model.assign_attributes(params[:model])
I have a date coming in along with the rest of the post data in the format mm/dd/yyyy
. Ruby appears to be parsing this date as if it is in the format dd/mm/yyyy
, as far as I can tell. So, when I enter a date of 4/15/2014
, for instance, the model fails to save because the month 15
does not exist (I assume, in reality I am just told that the date field is required).
How can I configure Ruby to parse my dates as mm/dd/yyyy
?