12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- SimpleForm.setup do |config|
- config.wrappers :bootstrap, tag: 'div', class: 'control-group', error_class: 'error' do |b|
- b.use :html5
- b.use :placeholder
- b.use :label
- b.wrapper tag: 'div', class: 'controls' do |ba|
- ba.use :input
- ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
- ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
- end
- end
- config.wrappers :prepend, tag: 'div', class: "control-group", error_class: 'error' do |b|
- b.use :html5
- b.use :placeholder
- b.use :label
- b.wrapper tag: 'div', class: 'controls' do |input|
- input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
- prepend.use :input
- end
- input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
- input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
- end
- end
- config.wrappers :append, tag: 'div', class: "control-group", error_class: 'error' do |b|
- b.use :html5
- b.use :placeholder
- b.use :label
- b.wrapper tag: 'div', class: 'controls' do |input|
- input.wrapper tag: 'div', class: 'input-append' do |append|
- append.use :input
- end
- input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
- input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
- end
- end
-
-
-
-
- config.default_wrapper = :bootstrap
- end
|