-
-
Save fongfan999/b3188d84e0eefeae30a264e23816f0a9 to your computer and use it in GitHub Desktop.
config/initializers/simple_form_materialize-sass.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this setup block to configure all options available in SimpleForm. | |
SimpleForm.setup do |config| | |
config.error_notification_class = 'alert alert-danger' | |
config.button_class = 'waves-effect waves-light btn' | |
config.boolean_label_class = nil | |
config.wrappers :vertical_form, tag: 'div', class: 'input-field', error_class: 'has-error' do |b| | |
b.use :html5 | |
b.use :placeholder | |
b.optional :maxlength | |
b.optional :pattern | |
b.optional :min_max | |
b.optional :readonly | |
b.use :input | |
b.use :label | |
b.use :error, wrap_with: { tag: 'span', class: 'error-block' } | |
b.use :hint, wrap_with: { tag: 'span', class: 'help-block' } | |
end | |
config.wrappers :vertical_boolean, tag: 'p', error_class: 'has-error' do |b| | |
b.use :html5 | |
b.optional :readonly | |
b.use :input | |
b.use :label | |
b.use :error, wrap_with: { tag: 'span', class: 'error-block' } | |
b.use :hint, wrap_with: { tag: 'span', class: 'help-block' } | |
end | |
config.wrappers :vertical_radio_and_checkboxes, tag: 'p', error_class: 'has-error' do |b| | |
b.use :html5 | |
b.optional :readonly | |
b.use :input | |
b.use :label | |
b.use :error, wrap_with: { tag: 'span', class: 'error-block' } | |
b.use :hint, wrap_with: { tag: 'span', class: 'help-block' } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment