如何做一个简单的 HAML 循环。在 ERB 视图中是这样的:
<table>
<tr>
<th></th>
<th></th>
</tr>
<%= @price. each do |row| %>
<tr>
<td><%= row.year %></td>
</tr>
<% end %>
</table>
示例刚刚尝试了这个:
%table
%tbody
%tr
%th year
%th price
错误:
Inconsistent indentation: 3 spaces were used for indentation