Help Troubleshooting HAML in Production vs. Development

8 views
Skip to first unread message

bdstevens

unread,
Dec 11, 2009, 5:12:50 PM12/11/09
to Haml
This is my first time in years posting to a group asking for help, but
I am stumped and could use some pointers for troubleshooting. My
issue is that I just converted a Rails app to use HAML templates. In
development, everything works fine, and the output is as expected.
When I moved it into production, everything appears fine in the
browser, but upon viewing the source, I notice that the HTML is not
indented properly (or, well, at all).

Here's the information I think is pertinent. If anything else is
needed, let me know.

I'm developing on OSX 10.6, using Ruby 1.9.1-p243 (and I tried with
p376 as well), PostgreSQL 8.4.1, Rails 2.3.4, and HAML 2.2.15. With
this setup, everything appears good.

My production setup is CentOS 5.2, PostgreSQL 8.4.1, Rails 2.3.4.
I've tried rubies 1.9.2dev, 1.9.1-p243, 1.8.6 and 1.8.7. I'm using
the HAML which I froze with my Rails app, 2.2.15.

I've done lots of troubleshooting. One of the odd things is that I
believe with 1.9.2dev (and/or 1.9.1-p243, I don't recall which) I
installed the HAML gem. When running HAML on the command line with a
simple HTML page header template, it produces the output as expected.
But the output I get through the Rails app has NO indenting in the
HTML output (verified by both viewing source from the browser and by
examining the output in the Rails console).

Can anyone give me pointers on how to troubleshoot where the problem
may be?

Chris Eppstein

unread,
Dec 11, 2009, 5:50:03 PM12/11/09
to ha...@googlegroups.com
In production mode, haml defaults to "ugly" mode for performance reasons.


--

You received this message because you are subscribed to the Google Groups "Haml" group.
To post to this group, send email to ha...@googlegroups.com.
To unsubscribe from this group, send email to haml+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



Rhett Sutphin

unread,
Dec 11, 2009, 6:53:38 PM12/11/09
to ha...@googlegroups.com
Hi Brian,

AFAIK, haml turns on ugly mode in production for better performance.

Rhett

Norman Clarke

unread,
Dec 11, 2009, 7:23:36 PM12/11/09
to ha...@googlegroups.com
I've seen this question asked a few times on the list now, so I just added a FAQ item in my fork and sent a pull request to Nathan.


--Norman

Nathan Weizenbaum

unread,
Dec 11, 2009, 7:33:20 PM12/11/09
to ha...@googlegroups.com
Good idea, Norman. I left a minor comment on there, but fix that and I'll merge it in.

Norman Clarke

unread,
Dec 11, 2009, 8:03:07 PM12/11/09
to ha...@googlegroups.com
Ok, all set. Thanks for the YARD tip; I just started working with it this week. 

I also went a little OCD and reworded the explanation of ugly_mode in the HAML_REFERENCE, and corrected a minor spelling error. 

I broke the changes up into different commits so you can cherry-pick out the minor stylistic change if you don't like it.

--Norman

Nathan Weizenbaum

unread,
Dec 11, 2009, 10:34:33 PM12/11/09
to ha...@googlegroups.com
Merged in. Thanks!

bdstevens

unread,
Dec 14, 2009, 10:15:28 AM12/14/09
to Haml
Thanks for the quick and utterly accurate response. I'm embarassed I
didn't see that!
> > haml+uns...@googlegroups.com <haml%2Bunsu...@googlegroups.com>.

Norman Clarke

unread,
Dec 14, 2009, 10:20:37 AM12/14/09
to ha...@googlegroups.com
No worries, you were definitely not the only one!

To unsubscribe from this group, send email to haml+uns...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages