开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜