Save Your Users Bandwidth Using Ugly Mode In SLIM Or HAML

Posted by Weston Ganger on April 12, 2016

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:

Posted in Rails and Tagged with haml slim ruby rails 

Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts