Create a local variable in Haml only
Drop the $ to avoid declaring a global variable. It should work just fine. !!! 5 %body / Declare Variable – type=”Audio” .container{:id => “page-#{type}”}
Drop the $ to avoid declaring a global variable. It should work just fine. !!! 5 %body / Declare Variable – type=”Audio” .container{:id => “page-#{type}”}
You need to use the #preserve helper to convert the newlines in the pre to newline entities, like so: %pre.code = preserve do :escaped <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html> <head></head> <body> <form> <input type=”text” name=”empID” /> <input type=”submit”/> </form> </body> </html> In the future, you’ll be able to nest filters, so … Read more
This gem will do the trick http://github.com/indirect/haml-rails
Haml excels for structural markup, but it’s not really intended for inline markup. Read: Haml Sucks for Content. Just put your inline tags as HTML: .content %p Lorem ipsum <em>dolor</em> sit amet. Or else use a filter: .content :markdown Lorem ipsum *dolor* sit amet.
With this: %h1< Lorem ip %span.red> sum %span.subtitle dolor Output looks like this: <h1>Lorem ip<span class=”red”>sum</span><span class=”subtitle”>dolor</span></h1> HAML Whitespace Removal