you are here: codestackercodes [RSS]rails 3 url validation

rails 3 url validation

# paste in your model


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

Comments