How to debug templates not being rendered?

Hi,

After upgrading to the repo version of Nitro, I’m not seeing
rendering of my templates. However, it appears the controller
is behaving normally from watching the log information.

However, when I run the demo/blog app, its templates DO get
rendered!

So I’m trying to understand what is different between the blog
and my app.

The directory structure of my app puts template/ at the root:

conf
log
public
public/js
public/media
public/stylesheets
public/doc
run.rb
src
template

However, I have checked the runtime value of Template.root_dir,
and it is “template”, so that seems OK.

Note: If I put a print “hello” in one of my controller methods,
then at least the “hello” DOES show up in the browser.

At this point I’m hoping for some tips on how to debug why my
templates aren’t being rendered. (Any particularly good places
in nitro or raw I should add a printout?) It’s not obvious to me
what is different between my app and the demo/blog app.

(Note: my templates use the extension .htmlx)

Thanks for any ideas,

Regards,

Bill

Bill K. schreef:

(Note: my templates use the extension .htmlx)

That’s probably the problem, in the current version the x was dropped,
try renaming them to .html (same for cssx -> css).

(ab)

Thanks for any ideas,

Regards,

Bill


Ein Fuchs muß tun, was ein Fuchs tun muß
[email protected]

From: “Arne B.” [email protected]

Bill K. schreef:

(Note: my templates use the extension .htmlx)

That’s probably the problem, in the current version the x was dropped,
try renaming them to .html (same for cssx → css).

Thanks, I’ve tried that now, but it made no difference.

When I use strace on the demo/blog app, I can see nitro reading the
template files:

stat64(“app/template/view.html”, {st_mode=S_IFREG|0640, st_size=133,
…}) = 0
open(“app/template/view.html”, O_RDONLY|O_LARGEFILE) = 7
stat64(“app/template/post.inc.html”, {st_mode=S_IFREG|0640, st_size=242,
…}) = 0
open(“app/template/post.inc.html”, O_RDONLY|O_LARGEFILE) = 7

However, when I strace my app, I don’t see nitro ever trying to
read my template files.

Not sure why…

At this point I guess I’ll be putting some printouts in nitro
and raw to try to understand how it works… Any tips would be
appreciated… :slight_smile:

Regards,

Bill

From: “Bill K.” [email protected]

However, when I strace my app, I don’t see nitro ever trying to
read my template files.

Not sure why…

At this point I guess I’ll be putting some printouts in nitro
and raw to try to understand how it works… Any tips would be
appreciated… :slight_smile:

Auuugh!

It was the debugging printout I had added to my controller method,
when things initially weren’t working, that prevented it from ever
working again no matter what I tried… :frowning:

Initially when my templates didn’t render, I put a: print “fubar”
as the last line of my controller method. So I could see the
“fubar” on the web page…

I didn’t realize that would prevent templates from being processed
going forward…

LOL :frowning:

Regards,

Bill