Neeraj Kumar
2005-Oct-18 06:37 UTC
Date validation for <%= date_select ''user'',''dob'' %>
If I select Feb 31 2005 from the three drop downs generated by <%date_select ''user'',''dob'' %> no error is flagged by default. I was wondering if there is something like validates_date :dob . How do I validate date against the the Feb 31 data. What am I missing here? -=- Neeraj _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Neville Burnell
2005-Oct-18 07:32 UTC
RE: Date validation for <%= date_select ''user'',''dob'' %>
AFAIK, there is no helper for date validation in Rails at the moment ... there is a Ruby library method, Date::validate_civil? which might help. Check out the doc using ri ... ri valid_civil? ________________________________ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Neeraj Kumar Sent: Tuesday, 18 October 2005 4:37 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] Date validation for <%= date_select ''user'',''dob'' %> If I select Feb 31 2005 from the three drop downs generated by <%date_select ''user'',''dob'' %> no error is flagged by default. I was wondering if there is something like validates_date :dob . How do I validate date against the the Feb 31 data. What am I missing here? -=- Neeraj _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails