使用simple_form和Bootstrap时遇到问题3.关于输入的包装器标签.显示以下代码:
查看代码(带haml)
= simple_form_for @refer_email_form, url: create_refer_message_path, html: { class: "form-horizontal" } do |f|
= f.input :to, label_html: { class: "col-sm-2" }
= f.input :subject, label_html: { class: "col-sm-2" }
Run Code Online (Sandbox Code Playgroud)
配置/ simple_form_bootstrap.rb
SimpleForm.setup do |config|
config.input_class = "form-control"
config.wrappers :bootstrap, tag: 'div', class: 'form-group', error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label, class: "control-label"
# b.wrapper tag: 'div', class: "col-sm-6" do |ba|
b.wrapper tag: 'div' do |ba|
ba.use :input
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' …Run Code Online (Sandbox Code Playgroud)