You are here: Browse Railsplugins Validates As Ip Address
= validates_as_ip_address
Adds a validation that makes sure an attribute contains a valid ip address. Only basic format checking and number range checing is done, so ‘0.0.0.0’ will still be valid.
= Usage
validates_as_ip_address :ip validates_as_ip_address :ip, :message => ‘not a valid ip address’ validates_as_ip_address :ip, :allow_nil => true
also supports validating MAC addresses:
validates_as_mac_address :mac
= Author
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly