Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 包装';简单形式';_Ruby On Rails_Haml_Simple Form - Fatal编程技术网

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