Ruby on rails 包装';简单形式';
我无法以简单的形式生成此输出: 我当前的包装器:Ruby on rails 包装';简单形式';,ruby-on-rails,haml,simple-form,Ruby On Rails,Haml,Simple Form,我无法以简单的形式生成此输出: 我当前的包装器: config.wrappers :inline_checkbox, :tag => 'div', :class => 'checkbox check-default', :error_class => 'error' do |b| b.use :html5 b.use :label_input, :wrap_with => { :class => 'checkbox inline' } end 更新 我无意
config.wrappers :inline_checkbox, :tag => 'div', :class => 'checkbox check-default', :error_class => 'error' do |b|
b.use :html5
b.use :label_input, :wrap_with => { :class => 'checkbox inline' }
end
更新
我无意中忽略了以下几点:
# Define the way to render check boxes / radio buttons with labels.
# Defaults to :nested for bootstrap config.
# inline: input + label
# nested: label > input
config.boolean_style = :inline
我有第二个初始值设定项。。。谢谢你给我指出了正确的方向。我不是专家,但请记住,
:label\u input
输出label
和input
按默认顺序一起输出。也许你应该试试:
config.wrappers :inline_checkbox, :tag => 'div', :class => 'checkbox check-default', :error_class => 'error' do |b|
b.use :html5
b.use :input
b.use :label
end
谢谢你的提示!我完全忽略了用于简单表单的第二个初始值设定项。。。它没有解决问题,但指向了正确的方向,因此我接受,我将更新问题…如果您使用Zurb基金会的simple_form,我已经解决了这个问题:
config.wrappers :inline_checkbox, :tag => 'div', :class => 'checkbox check-default', :error_class => 'error' do |b|
b.use :html5
b.use :input
b.use :label
end