Can I use haml template engine instead of erb?

I like a jets and trying to port my rails app to jets(not afterburner mode).
My rails application use haml template engine.

So, I’d like to use haml with jets.
Is there any way to use haml?

@ruzia Dug into this a little bit. There are 2 options:

  1. Use the tongueroo/haml fork that has the changes needed. Example:


gem "haml", git: ""

Unsure if #1 will eventually be accepted and merged into the haml upstream project:

  1. Add config/initializers/haml.rb

Here’s the initializer code:

With the 2nd approach, you can keep up with haml updates by updating the haml gem with bundler update. With the fork, changes will only be updating if the fork is updated.

Think overall, would probably go with #2. Since don’t really plan to update the fork often TBH.

1 Like


I’ll try 2nd approach.

I tried a different approach and I just extracted it to a gem.

Could you test if this works for you?



That’s just awesome. Cleaner code also :+1: