SLIM is a Ruby templating engine. I love it and use it for every Rails project. It’s similar to HAML, but faster and more readable imo. However, I did run into one problem that was tough for me to diagnose.

The problem was in my mailers. The email that was sent out in the development environment was fine, but the emails sent out in production had random spaces in some words, and it could happen in different words every time (or sometimes not at all)!


Since debugging had to be done in production, it took a few hours, but finally I tried replacing my SLIM views with good old ERB and viola, problem solved.

I wish I had had more time to look into the problem, as I’m not even 100% sure it stems from the slim-rails gem. If you run into the same problem and have more time to diagnose, please let me know about it. But for now I recommend using something else for action mailer templates.