simple_form_foundation.rb 946 B

123456789101112131415161718192021222324252627
  1. # Use this setup block to configure all options available in SimpleForm.
  2. SimpleForm.setup do |config|
  3. config.wrappers :foundation, class: :input, hint_class: :field_with_hint, error_class: :error do |b|
  4. b.use :html5
  5. b.use :placeholder
  6. b.optional :maxlength
  7. b.optional :pattern
  8. b.optional :min_max
  9. b.optional :readonly
  10. b.use :label_input
  11. b.use :error, wrap_with: { tag: :small }
  12. # Uncomment the following line to enable hints. The line is commented out by default since Foundation
  13. # does't provide styles for hints. You will need to provide your own CSS styles for hints.
  14. # b.use :hint, wrap_with: { tag: :span, class: :hint }
  15. end
  16. # CSS class for buttons
  17. config.button_class = 'button'
  18. # CSS class to add for error notification helper.
  19. config.error_notification_class = 'alert-box alert'
  20. # The default wrapper to be used by the FormBuilder.
  21. config.default_wrapper = :foundation
  22. end