Answer the question
In order to leave comments, you need to log in
How to limit the time input field at the model level?
I don’t know how to solve the time input at the model / database level. The user can choose how much he can extend the time so that there is a step for entering time with an interval of 15 minutes 0,15,30 and so on. Thanks
Answer the question
In order to leave comments, you need to log in
validates :time, :inclusion => { :in => (0..3600).step(15).to_a}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question