title: Add http(s) to URL if it's not there?
body: <p>I'm using this regex in my model to validate an URL submitted by the user. I don't want to force the user to type the http part, but would like to add it myself if it's not there.</p>
  
  <pre><code>validates :url, :format =&gt; { :with =&gt; /^((http|https):\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+).[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$/ix, :message =&gt; " is not valid" }
  </code></pre>
  
  <p>Any idea how I could do that? I have very little experience with validation and regex..</p>