Answers for "validates_length_of rails"

0

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
Posted by: Guest on January-15-2021
1

length validation rails

validates :column_name, length: { minimum: 3 }
Posted by: Guest on January-18-2021

Browse Popular Code Answers by Language