Hi How can I do the validation of date expiry (if the date is less than today) in ruby.Can I do it using the validate method or other def in the model class? Thanks in advance, Sainaba.
on 2006-01-17 13:49
on 2006-01-17 15:21
sainaba sainu wrote: > How can I do the validation of date expiry (if the date is less > than today) in ruby. You can do something like this: def validate if expiry_date < Date.today errors.add(:expiry_date , "should be a future date") end end Eszter