On Sat, Feb 19, 2011 at 3:30 AM, cz <raymanojin / gmail.com> wrote:

> Hi:
>
> Isit possible to embed ruby code in Haml templates. True, using
> variables seems to work fine. However, even a simple for loop
> generates errors. Other members have made suggestions, but none of
> them have worked. Below is a simple Haml template. When it is used in
> conjunction witha a Haml layout, an Html page is displayed. Four
> indexes of an array are displayed. How could a for loop accomplish the
> same thing? Thank you much.
>
> cz
>
> #contentID
>  %h3 Haml Template
>  %p All work and no play makes Jack a dull boy.
>  .divbtm
>  %p #{@ary.at(0)}
>  %p #{@ary.at(1)}
>  %p #{@ary.at(2)}
>  %p #{@ary.at(3)}
>
>
Dashes are for zero-width ruby, such as control characters, and equal signs
will embed Ruby, ie interpolation.

- @ary.each do |element|
  %p= element