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 - Ruby / Rails

Date:April 12, 2016