“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it. Currently working for InPay who are based in Denmark...”

Rob Lacey
Senior Software Engineer, UK

HAML whitespace

I came across a weird HAML syntax in a client codebase that I was just confused about.

Haml::Engine.new(%q{
- title = '1'
.title== #{title}<br/>
}).to_html
=> <div class='title'>1<br/></div>

I found an alternative syntax, I am not sure I like it but it’s certainly better than the above.

Haml::Engine.new(%q{
- title = '1'
.title<
 #{title}
 %br>
}).to_html
=> <div class='title'>1<br></div>

Basically you can kill whitespace with < >