Sha256: 01d7838a81ef52ff72f3e08acc8fc239a86bb7dae348699619c014c0fc82eadb

Contents?: true

Size: 976 Bytes

Versions: 4

Compression:

Stored size: 976 Bytes

Contents

require 'simple_form/version'

if SimpleForm::VERSION.to_i >= 2
  SimpleForm.setup do |config|
  
    config.label_text = lambda { |label, required| "#{label} #{required}" }
    config.required_by_default = false
    config.country_priority = 'United States'
    config.default_input_size = 30
  
    config.wrappers tag: :li, class: 'field', error_class: 'invalid-field' do |b|
      b.use :html5
      b.use :placeholder
    
      b.optional :maxlength
      b.optional :pattern
      b.optional :min_max
      b.optional :readonly
        
      b.use :label_input, wrap_with: { error_class: 'invalid', tag: false }
      b.use :hint,        wrap_with: { tag: :span, class: :hint }
      b.use :error,       wrap_with: { tag: :span, class: :error }
    end
  end
  
  SimpleForm.html5 = true
  SimpleForm.error_method           = :first
  SimpleForm.error_notification_id  = nil
  SimpleForm.browser_validations    = false
  SimpleForm.collection_wrapper_tag = nil  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facades-1.0.3 lib/facades/support/simple_form.rb
facades-1.0.2 lib/facades/support/simple_form.rb
facades-1.0.1 lib/facades/support/simple_form.rb
facades-1.0.0 lib/facades/support/simple_form.rb