I am using date_select in my form, but it works incorrectly, for example all months have 31 days.
My form is:
=form_for @user do |f|
%p
Birthday:
%br
= f.date_select(:birthday, :start_year => 1940)
For example, when I choose June 31, it creates date July 1. Is possible to avoid this feature?
Not with the built in Rails date select. Your best bet is to look at something like the Jquery UI date picker or similar.
Unfortunately, due to the complexities of dates, it’s pretty hard to get a good date picker without relying on Javascript.
Note though, that Rails will let you validate the date on the server side ensuring that you’re not getting duff data through.