tags:

views:

25

answers:

1

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?

+3  A: 

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
Shtééf
This is it. Content either goes on the same line, or indented beneath. Not both.
Matchu
is that the rule?... i see. thanks. anybody know why this rule? because, without this rule, the code in part 2 of the original post makes sense too... is it to avoid some confusion in some other situation?
動靜能量
It looks like the syntax is simply defined as either **a)** tag and single line of contents on the same line or **b)** tag, and multiple lines of contents indented. I guess you could compare it to Ruby's two methods of supplying blocks: `do` and `{ }`
Shtééf