Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

validates length rails

class Person < ApplicationRecord
  validates :name, length: { minimum: 2 }
  validates :bio, length: { maximum: 500 }
  validates :password, length: { in: 6..20 }
  validates :registration_number, length: { is: 6 }
end
 
PREVIOUS NEXT
Tagged: #validates #length #rails
ADD COMMENT
Topic
Name
8+5 =