E
E
eldar_web2015-09-24 17:45:34
Ruby on Rails
eldar_web, 2015-09-24 17:45:34

How to put validation on a date in Ruby on Rails models ???

You can at least use this format dd.mm.yyyy.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2015-09-24
@Bublik

validates :start, :presence => true, :format => /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question