0
我有需要循環的搜索結果。每個循環都應該給我兩個表格行。到目前爲止的代碼是:Content_tag_for rails 3.2中的故障
<tbody>
<%= content_tag_for(:tr, @results) do |material| %>
<tr>
<td>Some content</td>
<td>Some content</td>
<td>Some content</td>
</tr>
<tr class="hide">
<td>Some content</td>
<td>Some content</td>
<td>Some content</td>
</tr>
<% end %>
</tbody>
的問題是,我用class和id在一個單獨的連續兩行以上獲得。我需要將這兩行包裹在一個ID中。
例如
<tr class="X" id="X"></tr>
<tr>
<td>Some content</td>
<td>Some content</td>
<td>Some content</td>
</tr>
<tr class="hide">
<td>Some content</td>
<td>Some content</td>
<td>Some content</td>
</tr>
我也有同樣的問題,當我嘗試使用div_for。在那種情況下,我得到了所有在行之前堆疊的ID。
我在做什麼錯?