Rails

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 


Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts