【发布时间】:2015-08-27 08:04:43
【问题描述】:
下面是我在 Rails 辅助方法中运行的循环。
part_child_option.each do |o|
html += "<div class='col-sm-2 uno_part_wrapper'>"
html += "<label class = 'p_name' for='#{attr_name}'>"
html += image_tag o.photo(:small), class: "tick_option_img",
html += "</label>"
html += "</div>"
end
html.html_safe
end
我现在有一个问题。 col-sm-2 类在那里,所以在我看来它在 row 类之下。该行在我的助手之外,因此我无法循环它。
指出的解决方案没有这种情况
现在我希望我的row 类在col-sm-2 完成六次后关闭。然后我想再次开始课程row,并且我的课程行中的所有内容都与上面相同。
我希望这个问题现在很清楚了。
如何做到这一点。
【问题讨论】:
-
无法集成到我的助手中。我的行在我的视野中
标签: html ruby-on-rails twitter-bootstrap