Save Your Users Bandwidth Using Ugly Mode In SLIM Or HAML

Posted by Weston Ganger

SLIM and HAML both have an ugly mode that compresses the html file to save bandwidth for your users.

Both Chrome and Safari automatically indent HTML for you so you don’t need to rely on the source for indenting to debug.

# config/application.rb

# For SLIM
Slim::Engine.options[:pretty] = false

# For HAML
Haml::Template.options[:ugly] = true

Both HAML and SLIM have these settings enabled in production mode by default.

Related External Links:

Article Topic:Software Development - Rails

Date:April 12, 2016

Recommended Posts



Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected