In Rails 3, is there a built in method for seeing if a string is a valid IP address?
If not, what is the easiest way to validate?
Just wanted to add that instead of writing your own pattern you can use the build in one Resolv::IPv4::Regex
require 'resolv'
validates :gateway, :presence => true, :uniqueness => true,
:format => { :with => Resolv::IPv4::Regex }