search for: only_numbers

Displaying 1 result from an estimated 1 matches for "only_numbers".

2006 Apr 12
0
Netmask validator
Sharing the wealth. I just finished working on a custom netmask validator and thought others might benefit. Of course, comments and suggestions are welcome. def validates_netmask(*attr_names) configuration = { :only_numbers => ''must only use numbers as octet values'', :range => ''has one or more octet values that are > 255'', :invalid => ''is invalid'' } configuration.update(attr_names.pop) if attr_names.last.is_a?(H...