开发者

why adding a simple div to HAML will break the code?

it is quite strange that the following works:

- 1.upto(30) do |i|
  = i
  %br

but the following won't:

%div this line
  - 1.upto(30) do |i|
    = i
    %br

Isn't the second part 开发者_运维问答just to add a div and let the numbers go into that div?


Was the this line part intended? Or are you indicating the error position? Because without it, the snippit works.

If this line is supposed to be content, then what you want is probably:

%div
  this line
  - 1.upto(30) do |i|
    = i
    %br
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜