开发者

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

开发者 https://www.devze.com 2023-01-02 09:18 出处:网络
it is quite strange that the following works: - 1.upto(30) do |i| = i %br but the following won\'t: %div this line

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

精彩评论

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