11 Aug 2009, 2:17pm
/dev/rails
by chris

leave a comment

Rails, date_select and “index out of string”

If you’re working in Rails and using date_select() or datetime_select() (and presumably select_date() and select_datetime()) and you find yourself up against an error like the following:

index 3873 out of string

Check that your :default parameter is either nil or an actual Date/Time/DateTime instance and not a String. Passing in a string as :default really messes things up.