Just had a quick test and yes it works, there is one slight change you
need to the code provided by Brad

%wrapper
   - some_hash.each do |key, value|
     = haml_tag(key, value)

the last line needs to be

- haml_tag(key, value)

as haml_tag emits into the buffer rather than its place in the
template if you catch my meaning.

Geoff

On Oct 11, 6:53 am, Brad Wilson <[EMAIL PROTECTED]> wrote:
> Not sure about #1 (it seems reasonable to me though).
> #2 should work using haml_tag I think. So something like the code  
> below might do it.
>
> %wrapper
>    - some_hash.each do |key, value|
>      = haml_tag(key, value)
>
> I've never used the haml_tag(name, text) version of haml_tag, so I'm  
> not too sure if that's perfect, but it should be close.
>
> Brad
>
> On 11/10/2008, at 4:07 PM, Chick wrote:
>
>
>
> > I really have two questions
> > 1 ) I want to use HAML to render arbitrary XML documents, not super
> > fancy XML, but I want to use it instead of builder, I don't see a lot
> > of references to anyone doing it.  Is this madness?
> > 2 ) To use it the way I want I would like to be able to specify tags
> > programmatically.
> > For example, something like
>
> > %wrapper
> >  - some_hash.each do |key,value|
> >    %#{key}= value
>
> > Seems like I am missing something but I can't figure out how to do
> > it.  Skimmed haml source but I don't see an escape or override for
> > this.
>
> > Thanks in advance (did I mention I like HAML a lot)
> > -chick
--~--~---------~--~----~------------~-------~--~----~
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