AFAIK, Ruby interpolation is allowed in the attributes but not in the tag
names, which include the shorthand #id and .class for %div's.

Best,
Alex

On Thu, Mar 4, 2010 at 5:44 PM, Michael Narciso <narke...@gmail.com> wrote:

> Hello all,
>
> Just had a brief conversation with Chris Eppstein as he demonstrated
> how I can loop through to get my desired result. It went something
> like this:
>
> Desired Result:
>
> <div class="item-1"></div>
> <div class="item-2"></div>
> <div class="item-3"></div>
>
> Code:
>
> - (1..3).each do |i|
>  %div{:class => "item-#{i}"}
>
> However, I was thinking... why doesn't the following code work:
>
> - (1..3).each do |i|
>  .item-#{i}
>
> I'm pretty new to Ruby and don't use to haml to build rails apps, just
> using it to build HTML mockups quickly.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to h...@googlegroups.com.
> To unsubscribe from this group, send email to
> haml+unsubscr...@googlegroups.com <haml%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to