It's not expected as such, but it is reasonable.  What's happening is 
that Haml takes everything to the left of the =, assigns a variable to 
it, and calls to_s. When you evaluate

  foo = "bar", "baz"

foo becomes

  ["bar", "baz"]

Calling to_s on this gives you

 "barbaz"

which is the behavior you're seeing here.

- Nathan

Chris Boone wrote:
> Hi all.
>
> I just ran into something unexpected, and I'm wondering whether it's a
> feature or a bug. Or a bug destined to become a feature.
>
> I had:
>
> %span.icon= image_tag("mockup/kenn.jpg", :alt => "Kenn Ejima"),
> profile_url(:username => "kenn")
>
> Which was a mistake. The profile_url is cruft from a refactoring, when
> the image_tag was surrounded by a link_to.
>
> Haml renders that as:
>
> <span class="icon">
>   <img alt="Kenn Ejima" src="/images/mockup/kenn.jpg"
> />http://localhost:3000/people/kenn
> </span>
>
> Which is interesting. Is the concatenation after evaluation of
> multiple Ruby expression separated by commas intended?
>
> Thanks.
>
>   


--~--~---------~--~----~------------~-------~--~----~
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