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