I bet somebody has a better way, but here's something I've done before
- capture the haml and then render it with or without the %body based
on your conditional. Not real pretty, but at least the ugliness is
mostly just confined to the top and bottom of the file. Something like
this:
- body = capture_haml do
- ...haml for everything in layout...
- if request.env['HTTP_USER_AGENT'] !~ /msie/i
%body= body
- else
= body