Class: BootstrapValidatorRails::Validators::Format
- Defined in:
- lib/bootstrap_validator_rails/validators/format_validator.rb
Instance Method Summary collapse
Methods inherited from Validator
#generate_message, #generate_object, #html_attributes, #initialize, #js_options, #unsupported?, #validator_options
Constructor Details
This class inherits a constructor from BootstrapValidatorRails::Validators::Validator
Instance Method Details
#generate_options! ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/bootstrap_validator_rails/validators/format_validator.rb', line 11 def return if unsupported? = regex = [:with].to_javascript regex.sub!('/^', '^') regex.sub!('$/', '$') ['regexp'] = {} @html_attributes[:bv_regexp] = 'true' if [:with] ['regexp']['regexp'] = regex @html_attributes[:bv_regexp_regexp] = regex end if [:message] ['regexp']['message'] = @html_attributes[:bv_regexp_message] = end end |