Rails does not have support for setting different options for different templates. I'm afraid your best bet is to use the :xhtml output format for Haml.
On Wed, Dec 22, 2010 at 5:18 AM, Magnus Bergmark <[email protected]>wrote: > Hi, > > Let's get straight to the problem. I'm using Rails 3. > > I want to have both index.html.haml and index.xml.haml (one for HTML5 > and one for API access). Problem is that I have to set the engine > options globally, so I have to choose between HTML5 and XML, right? In > HTML5, tags don't self-close and the <?xml ?> declaration goes away so > that's really unacceptable for XML. > > Is this solvable? > > Thanks, > Magnus > > -- > 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.
