HAML, by default in development renders “pretty”, correctly indented HTML output. In production it renders “ugly” output by default. I really appreciate the value of indented html output. If only so that when debugging HTML source (sometime DOM isn’t good enough) you can see the hierarchy of the page. Many an hour has been spent searching for that elusive missing closing
I have however always had problems setting the HAML :ugly option in production…. until now.
It seems that due to changes in the way rails loads, you now have to create an initializer (obvious really) and add the option there.
Haml::Template.options[:ugly] = false