lib/live_validations.rb
# Set which adapter to use. Pass the adapter class directly. Example:
#
#  LiveValidation.use(LiveValidations::Adapters::JQueryValidations)
Set which adapter to use. Pass the adapter class directly.
Set which adapter to use . Pass the adapter class directly .
def use(adapter_klass, options = {})
    @options = options.symbolize_keys
    case adapter_klass
    when String, Symbol
      adapter_name = "LiveValidations::Adapters::" + adapter_klass.to_s.camelize
      self.current_adapter = adapter_name.constantize
    when Class
      self.current_adapter = adapter_klass
    end
  rescue NameError => e
    raise AdapterNotFound, "The adapter `#{adapter_klass}' (#{adapter_name}) was not found."
  end
def use ( adapter_klass , options = { } ) @options = options . symbolize_keys case adapter_klass when String , Symbol adapter_name = "LiveValidations::Adapters::" + adapter_klass . to_s . camelize self . current_adapter = adapter_name . constantize when Class self . current_adapter = adapter_klass end rescue NameError => e raise AdapterNotFound , "The adapter `#{adapter_klass}' (#{adapter_name}) was not found." end
Set which adapter to use.
Set which adapter to use .
adapter_klass
<not_specific>
options
<not_specific>