Rails date select assigns month a value when blank
I am using Rails date_select as follows:
<%= date_select :user, :birthday, {:start_year => Time.now.year, :end_year => 1910,:order => [:day,:month,:year], :prompt => { :day => 'day', :month => 'month', :year => 'year' }}, { :class => "default" } %>
When a user forgets to enter a value for the day or month and submit the form when the information is put into the model an error is generated. However the day an开发者_运维技巧d month fields also get assigned to 1. This results in the form showing 1 for the day field and January for the month field.
How can I stop this from happening?
精彩评论