you are here: codestackercodes [RSS]rails 3 validates method

rails 3 validates method

validates :login, :presence => true, :length => {:minimum => 4}, :uniqueness => true, :format => { :with => /[A-Za-z0-9]+/ }

# :presence => true

# :uniqueness => true

# :numericality => true

# :length => { :minimum => 0, maximum => 2000 }

# :format => { :with => /.*/ }

# :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i } # email format

# :format => { :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix } # url format

# :inclusion => { :in => [1,2,3] }

# :exclusion => { :in => [1,2,3] }

# :acceptance => true

# :confirmation => true

Comments