Using Blocks

0 views
Skip to first unread message

NeX

unread,
Jun 25, 2009, 9:40:25 AM6/25/09
to Haml
Hi Guys, I'm having a parse problem using blocks on a HAML file.

Example:

- @item.each do | item |
= item.title
.....................................
.....................................

To solve the problem I should remove the spaces after the first pipe
and before the last one, like this:

- @item.each do |item|
= item.title
.....................................
.....................................

Is this related with the multiline string syntax?

Regards,
--
NeX

Nathan Weizenbaum

unread,
Jun 26, 2009, 2:22:35 AM6/26/09
to ha...@googlegroups.com
Yes; the first example is ambiguous with the multiline syntax. Don't put spaces around your pipes. It's not good Ruby style, anyway.
Reply all
Reply to author
Forward
0 new messages