render generates nothing

6 views
Skip to first unread message

Serenity

unread,
Nov 20, 2008, 6:59:17 PM11/20/08
to Haml
Hello,

I'm fairly new to Haml. I've run into a number of situations where a
render of a haml template simply generates absolutely nothing. In
every case so far, it has turned out that the haml template was
calling a helper that had a ruby error in it.

But the problem is that this happens completely silently. I see
absolutely nothing on the console or in the web browser window to
indicate that anything went wrong, much less what - except that what
was supposed to be rendered is missing.

Is Haml supposed to emit some kind of error message when a template
fails? It's extremely slow to have to take an entire template, one
line and one helper call at a time, and assess whether that is where
it is failing.

Thanks
Avram

Nathan Weizenbaum

unread,
Nov 20, 2008, 9:29:56 PM11/20/08
to ha...@googlegroups.com
Erros in Haml templates - both syntax and not - should bubble up to the
toplevel. Last time I ran a diagnostic they did so, but it's possible
new versions of things might have changed that. Which Rails and Haml
versions are you using?

Serenity

unread,
Nov 21, 2008, 12:06:58 PM11/21/08
to Haml
I'm using Haml 2.0.4 and Rails 1.2.3.

Note that these errors are not in the haml template, they are helper
functions I've written to keep the Haml clean. It is the helper
functions that do not report back when they choke after being called
from a haml template.

Chris Eppstein

unread,
Nov 21, 2008, 1:09:15 PM11/21/08
to ha...@googlegroups.com
Can you post some of your code so we can see it?

chris

Avram Dorfman

unread,
Nov 22, 2008, 5:29:41 AM11/22/08
to ha...@googlegroups.com, Chris Eppstein
I'd be happy to. However my app is fairly extensive. I will have to
develop a reduced version of the scenario so I can be sure I'm
including all of the relevant code.

Perhaps producing this will narrow down my problem; maybe all I needed
to hear was that yes, in fact, Haml is expected to reflect problems in
helper code just like it does with embedded code.

I'll get back to you either with an analysis of the problem &
solution, or a sufficiently focused example.

Thanks.

Reply all
Reply to author
Forward
0 new messages