DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Validate Minimum Age Using A Birthday Value

10.28.2005
| 6033 views |
  • submit to reddit
        
  validates_inclusion_of :birthday,
    :in => Date.new(1900)..Time.now.years_ago(18).to_date,
    :message => 'Too young, dude!'