Closed RailsCod3rFuture closed 8 years ago
I fixed the error by converting the attribute's type into a date. I'm still having problems with the showing date format. It says %d/%y/%m. I need month/date/year. As, I have written above.
@RailsCod3rFuture This might be a very silly question but have you tried %m/%d/%Y ?
It worked. Thanks!
When I type 05/25/1987 into the text box. I receive "Object must be a Date, DateTime or Time object." error upon returning to the form. I had to literally delete the attribute just to edit the form. How can I get the format to match my requirements?
validates_format_of :birthday, :with => /\d{2}\/\d{2}\/\d{4}/, :message => '^Date must be in the following format: mm/dd/yyyy'