I’m having a tough time even finding a point to start debugging this. Basically, I’m setting up a copy of Shapado, a fairly normal Rails 3 app that has lots of .html.haml views like this:
.author
%span
= I18n.t('global.by_semi')
= render :partial => "users/user_mini" ...
The first time I load a page on my site in production mode, all the tags in the output get crunched together:
<div class="author"><small><span>Asked by</span><a href="/users/jpatokal"
data-layout="user" rel="author">Jani</a>6
Which renders incorrectly as “Asked byJani6″.
But in development mode, and (even more oddly) also the second and subsequent times I load the same page in production mode, the tags are separated by linefeeds:
<div class="author">
<small>
<span>
Asked by
</span>
<a href="/users/jpatokal" data-layout="user" rel="author">Jani</a>
6
And since linefeeds are space in HTML, this now renders correctly: “Asked by Jani 6″
I presume this has something to do with Rails 3 asset pipelining, minification and/or caching, but as far as I can figure out the config (see Gitorious) does not actually pipeline Haml. A quick looksie through a diff of config/environments/development.rb with c/e/production.rb also doesn’t reveal anything obviously relevant. Help?
Output should not change in subsequent calls. Try to update HAML with
bundle update haml.You can force “ugly” mode to
falsein yourapplication.rborproduction.rb:http://haml.info/docs/yardoc/file.HAML_REFERENCE.html#options