Ticket #133 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Regression: template handlers not loaded

Reported by: b.candl..@pobox.com Assigned to:
Priority: major Milestone: 0.4
Component: Merb Keywords:
Cc:

Description

The test application from ticket #118 runs under 0.3.7. However it fails under trunk (r419). It gives an exception "can't convert nil into String"

If you apply the patch in #132, the exception becomes "No template matching .../app/views/foo/bar.{}".

This shows that @@template_extensions is empty. Also: when I run merb, I don't get the warnings which 0.3.7 gave me:

You need to install the mailfactory gem to use Merb::Mailer
you must install the markaby gem to use .mab templates
you must install the builder gem to use .rxml templates
you must install the haml gem to use .haml templates

Now, in r401 lib/merb/template.rb was changed so that instead of loading all the template classes, it just sets them to autoload.

Therefore, I can work around the problem by adding the following line to conf/merb_init.rb:

Merb::Template::Erubis

Maybe this new behaviour is intentional, to avoid loading template handlers that are not needed in an application. However if it is, I can see no mention of it in README or History.txt yet. In any case, it would make sense for the skeleton merb_init.rb to include something like this to get at least the Erubis template handler loaded.

Change History

08/18/07 06:14:56 changed by b.candl..@pobox.com

Hmm, sorry this seems to be a duplicate of #130 (although I don't agree with the solution proposed there)

08/18/07 06:36:28 changed by b.candl..@pobox.com

  • status changed from new to closed.
  • resolution set to duplicate.

08/21/07 11:39:41 changed by jon.egil.stra..@gmail.com

  • status changed from closed to reopened.
  • resolution deleted.

The duplicate #130 is closed in favour of the solution proposes here, so this is now reopened.

08/21/07 11:57:03 changed by pmisiowi..@mac.com

Useful tip: don't apply #132 if you are applying this patch. Otherwise, the application will then expect a layout file matching the name of your view (even if application.herb exists) and you'll get a nasty exception. With that said, I've confirmed this patch works beautifully against a test app.

08/23/07 00:47:42 changed by jon.egil.stra..@gmail.com

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [421]) Explicit loading of template handlers (fixes #133) and improved error message for missing templates (fixes #132). Kudos to b.candler and pmisiowiec