From: Brian Candler Date: 2011-02-17T23:04:55+09:00 Subject: Re: Ruby code in Haml James Brister wrote in post #982179: > You need '-' at the start of a line with ruby code otherwise haml just > passes it through Also indentation is important. > > - for x in 0..@ary.length > #{@ary.at(x)} I think it's clearer to use regular HAML insertion inside the block, instead of ruby string expansion: - for x in 0..@ary.length = @ary.at(x) And of course, "each" is better here. - @ary.each do |elem| = elem Standalone example, showing some nested tags: $ haml < 1 4 9 16 -- Posted via http://www.ruby-forum.com/.