Skip to content

Commit b2ffbc1

Browse files
committed
Update the Wrappers API in the generator
1 parent c8b6ec5 commit b2ffbc1

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/generators/simple_form/templates/config/initializers/simple_form.rb.tt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,41 +41,41 @@ SimpleForm.setup do |config|
4141

4242
## Inputs
4343
b.use :label_input
44-
b.use :hint, :tag => :span, :class => :hint
45-
b.use :error, :tag => :span, :class => :error
44+
b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
45+
b.use :error, :wrap_with => { :tag => :span, :class => :error }
4646
end
4747
<% if options.bootstrap? %>
4848
config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
4949
b.use :placeholder
50-
b.use :label, :class => 'control-label'
51-
b.use :tag => 'div', :class => 'controls' do |ba|
50+
b.use :label, :wrap_with => { :class => 'control-label' }
51+
b.wrapper :tag => 'div', :class => 'controls' do |ba|
5252
ba.use :input
53-
ba.use :error, :tag => 'span', :class => 'help-inline'
54-
ba.use :hint, :tag => 'p', :class => 'help-block'
53+
ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
54+
ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
5555
end
5656
end
5757

5858
config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
5959
b.use :placeholder
60-
b.use :label, :class => 'control-label'
61-
b.use :tag => 'div', :class => 'controls' do |input|
62-
input.use :tag => 'div', :class => 'input-prepend' do |prepend|
60+
b.use :label, :wrap_with => { :class => 'control-label' }
61+
b.wrapper :tag => 'div', :class => 'controls' do |input|
62+
input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
6363
prepend.use :input
6464
end
65-
input.use :hint, :tag => 'span', :class => 'help-block'
66-
input.use :error, :tag => 'span', :class => 'help-inline'
65+
input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
66+
input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
6767
end
6868
end
6969

7070
config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
7171
b.use :placeholder
72-
b.use :label, :class => 'control-label'
73-
b.use :tag => 'div', :class => 'controls' do |input|
74-
input.use :tag => 'div', :class => 'input-append' do |append|
72+
b.use :label, :wrap_with => { :class => 'control-label' }
73+
b.wrapper :tag => 'div', :class => 'controls' do |input|
74+
input.wrapper :tag => 'div', :class => 'input-append' do |append|
7575
append.use :input
7676
end
77-
input.use :hint, :tag => 'span', :class => 'help-block'
78-
input.use :error, :tag => 'span', :class => 'help-inline'
77+
input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
78+
input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
7979
end
8080
end
8181

0 commit comments

Comments
 (0)