Sha256: d4ec7131c3cd87c08fa25019b151ff3a7aaba04d83125b5709ccad670e08a803
Contents?: true
Size: 325 Bytes
Versions: 13
Compression:
Stored size: 325 Bytes
Contents
format :html do def editor :text_field end end event :validate_number, :validate do errors.add :content, "'#{content}' is not numeric" unless valid_number?(content) end def valid_number? string valid = true begin Kernel.Float(string) rescue ArgumentError, TypeError valid = false end valid end
Version data entries
13 entries across 13 versions & 1 rubygems