You're using = with your #each loop, which means that Haml will print out
the return value of #each as well as the last name of each customer. Use -
instead when you don't want the output printed.

On Wed, Nov 3, 2010 at 9:26 AM, Marcus <[email protected]> wrote:

> Hello all,
>
> I am using Rails 3.0.1 with Haml 3.0.23. When I write this in ERB:
>
> <% @customers.each do |p| %>
> <%= p.last_name %>
> <% end %>
>
> I get output like: "Smith Jones Davis". When I write this similar code
> in Haml:
>
> = @customers.each do |p|
>  = print.last_name
>
> I get output like: "Smith Jones Davis #<Customer:0xb66f1e20>#<Customer:
> 0xb66f17e0>#<Customer:0xb66f1790>"
>
> What am I doing wrong?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <haml%[email protected]>.
> 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 [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to