![](/img/trans.png)
[英]Error: haml syntax error, unexpected keyword_ensure, expecting $end
[英]HAML: syntax error, unexpected keyword_ensure, expecting $end
收到上述錯誤(列為錯誤的行號在文件結尾之后)
%H1= 'Week '+@week
-@days.each |day| #do
%H2= 'Day '+day
%table{:id => "day_#{day}"}
%thead
%tr
%th Back Squat (reps)
%th %1RM
%th Weight
%th Front Squat (reps)
%th %1RM
%th Weight
%tbody
-@workout[day].each |set| #do
%tr
%td= set.first.reps
%td= 100 * set.first.percentage
%td= set.first.percentage * @bs_1rm
-unless set.last.nil?
%td= set.last.reps
%td= 100 * set.last.percentage
%td= set.last.percentage * @fs_1rm
-else
%td/
%td/
%td/
有任何想法嗎? 在HAML中,通常是縮進問題,但我沒有看到...
這個:
-@days.each |day| #do
應該:
- @days.each do |day|
使用haml,您不會end
障礙,但是您必須使用do
來打開它
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.