Validate URL in model


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. validates_format_of :company_url, :with => /((http|https):\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?)/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.