You should be able to handle this simply by adding using "- " for each line
in the helper. You shouldn't need the multiline block syntax at all.

On Wed, Jan 26, 2011 at 8:48 AM, Russell Garner <[email protected]>wrote:

> Hi,
>
> I'm upgrading an application from Erb to Haml and I've come across a
> DSL-style helper that I can't find a translation for.  It's for
> inspecting a content item and outputting some meta tags based on
> properties that content item has.  In Erb, its usage looks like this:
>
> <%
>   # Locals: content_item - an index, article, or something with
> metadata
>   -%>
> <%=
>    meta_tags(content_item) do
>        meta 'keywords', content_item.keyword_list
>        meta :language
>        meta 'DC.language'
>        meta 'DCTERMS.modified'
>        meta 'DCTERMS.description'
>        meta 'DC.subject'
>        meta 'DC.creator'
>    end
> %>
>
> html2haml translated this into the (non-working)
>
> - ## Locals: content_item - an index, article, or something with
> metadata
>  = meta_tags(content_item) do                    |
>      meta('keywords', content_item.keyword_list) |
>      meta(:language)                             |
>      meta('DC.language')                         |
>      meta('DCTERMS.modified')                    |
>      meta('DCTERMS.description')                 |
>      meta('DC.subject')                          |
>      meta('DC.creator')                          |
>    end                                           |
>
> I've tried about every combination I can think of here (semicolons on
> line ends, removal of redundant end, etc etc).  Short of actually
> making this DSL-like call in a helper (which I don't particularly want
> to do because it's an extra level of indirection and this is already
> in a partial), I'm not sure what to do.
>
> Is this a use case that Haml specifically tries to dissuade? Or have I
> missed something glaring?
>
> Cheers,
>
> Russ
>
> --
> 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