能给予我仍然不清楚为什么这个打破:Haml打破。非法嵌套:内容无法同时在同一行
.form-box
%h3 Restrictions
%legend Restricted Locations
= form_for [:blueadmin, :wine, @wine], html: {class: 'form-horizontal col-lg-2'} do |f|
%fieldset.inputs
.control-group
= f.label :us_states, "US States", class: 'control-label'
.controls
= f.collection_select :product, Restriction.all, :us_state, :us_state, {}, :multiple => 'true'
%fieldset
%ol
%li.button
= f.submit "Submit", class: 'btn btn-primary'
%table.table.table-hover.table-condensed.story-list
%th State
%th Remove
我得到的错误是: Illegal nesting: content can't be both given on the same line as %legend and nested within it.
的= form_for
似乎是元凶
我知道受限位置与%legend相同......但这就是我看文档的方式。
这工作,虽然,但它搞砸了我的传说边境:
.form-box
%h3 Restrictions
%legend
Restricted Locations
= form_for [:blueadmin, :wine, @wine], html: {class: 'form-horizontal col-lg-2'} do |f|
%fieldset.inputs
.control-group
= f.label :us_states, "US States", class: 'control-label'
.controls
= f.collection_select :product, Restriction.all, :us_state, :us_state, {}, :multiple => 'true'
%fieldset
%ol
%li.button
= f.submit "Submit", class: 'btn btn-primary'
%table.table.table-hover.table-condensed.story-list
%th State
%th Remove
它看起来像这样:
(注意如何细线在不同的地方)
最后,我如何让底部的表格出现在表单的右侧,而不是底部?我如何使用列来做到这一点?
压痕结果的任何变化,我不知道你应该做的'= form_for'。每当我在haml中使用'form_for',它就是' - form_for'。 – stef