Class: BootstrapValidatorRails::Validators::Presence

Inherits:
Validator
  • Object
show all
Defined in:
lib/bootstrap_validator_rails/validators/presence_validator.rb

Direct Known Subclasses

Acceptance

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!(options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/bootstrap_validator_rails/validators/presence_validator.rb', line 4

def generate_options!(options = {})
  return if unsupported?

  @js_options['notEmpty'] = {} 
  @html_attributes[:bv_notempty] = 'true'

  @js_options['notEmpty']['message'] = generate_message
  @html_attributes[:bv_notempty_message] = generate_message 
end