Forum: Nitro How to debug templates not being rendered?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4feed660d3728526797edeb4f0467384?d=identicon&s=25 Bill Kelly (Guest)
on 2007-12-18 10:38
(Received via mailing list)
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
Bd10252dc68b39171cc9bf5f74bcb9f1?d=identicon&s=25 Arne Brasseur (Guest)
on 2007-12-18 10:51
(Received via mailing list)
Bill Kelly 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ß
arne@arnebrasseur.net
4feed660d3728526797edeb4f0467384?d=identicon&s=25 Bill Kelly (Guest)
on 2007-12-18 19:25
(Received via mailing list)
From: "Arne Brasseur" <arne@arnebrasseur.net>
> Bill Kelly 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... :)


Regards,

Bill
4feed660d3728526797edeb4f0467384?d=identicon&s=25 Bill Kelly (Guest)
on 2007-12-18 20:08
(Received via mailing list)
From: "Bill Kelly" <billk@cts.com>
>
> 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... :)

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... :(

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 :(


Regards,

Bill
This topic is locked and can not be replied to.