URI validation for ActiveModel
You can install as gem:
gem "validates_as_uri"
Or as plugin:
$ rails plugin install git://github.com/sobrinho/validates_as_uri.git
class Repository < ActiveRecord::Base validates :url, :uri => { :protocols => %w(git svn) } validates :homepage, :uri => true # default protocols are %w(http https) end
Copyright © 2009-2010 Gabriel Sobrinho, released under the MIT license