Skip to content

Commit 6eb76b2

Browse files
committed
Merge pull request browsermedia#702 from andyoll/use_browsercms_wrapper_config_for_simple_form
use named wrapper config for simple_form
2 parents 00f6335 + 08851e6 commit 6eb76b2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/helpers/cms/form_tag_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module FormTagHelper
88
# support.
99
def content_block_form_for(object, *args, &block)
1010
options = args.extract_options!
11-
simple_form_for(engine_aware_path(object), *(args << options.merge(builder: Cms::FormBuilder::ContentBlockFormBuilder)), &block)
11+
simple_form_for(engine_aware_path(object), *(args << options.merge(builder: Cms::FormBuilder::ContentBlockFormBuilder, wrapper: 'browsercms')), &block)
1212
end
1313

1414
# Simple wrapper for Rails form_for that will use the CMS CustomFormBuilder.

lib/cms/configure_simple_form_bootstrap.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
b.use :hint, wrap_with: {tag: 'p', class: 'help-block'}
1010
end
1111

12+
config.wrappers :browsercms, tag: 'div', class: 'control-group row-fluid', error_class: 'error' do |b|
13+
b.use :html5
14+
b.use :placeholder
15+
b.use :label
16+
b.use :input
17+
b.use :error, wrap_with: {tag: 'span', class: 'help-inline'}
18+
b.use :hint, wrap_with: {tag: 'p', class: 'help-block'}
19+
end
20+
1221
config.wrappers :checkbox, :tag => 'div', :class => 'control-group row-fluid', :error_class => 'error' do |b|
1322
b.use :html5
1423
b.use :placeholder

0 commit comments

Comments
 (0)