我无法使用简单格式生成此输出:
.row
.checkbox.check-default
%input#checkbox1{:checked => "checked", :type => "checkbox", :value => "1"}/
%label{:for => "checkbox1"} Keep Me Signed in
我目前的包装:
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
我有第二个初始化程序...感谢您指出我正确的方向..
答案 0 :(得分:0)
我不是专家,但请记住:label_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