Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Render template without TemplateHandler extension

#1798

If you try to render a template which doesn't have a TemplateHandler extension it raises a MissingTemplate exception even so the file exists in the view_paths. E.g. if you have a file 'hello_world.js' which you try to render like this:


render :file => 'hello_world.js'

_pick_template doesn't find it an exception is thrown.

Reported by Daniel Guettler · January 26th, 2009 @ 04:47 PM

State: resolved
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. DHH
    DHH
    • Assigned user changed from Pratik to josh
    • Milestone cleared.

    February 5th, 2009 @ 08:11 PM

  2. josh
    josh
    • State changed from new to wontfix

    You should not need to add another conditional to the path finder. This should be handled by the template. The template should still be valid with a nil extension. But It looks like this case is already properly handled.

    Also, the tests pass w/o the actual patch. Maybe it was already unintentionally fixed?

    February 5th, 2009 @ 09:46 PM

  3. Daniel Guettler
    Daniel Guettler

    Right it's fixed in the master branch and in tag v2.3.0 since it again changed the whole template business... The patch applies to the 2.2-stable branch as I tried to indicate by setting the "2.2-stable" tag.

    February 5th, 2009 @ 10:05 PM

  4. Repository
    Repository
    • State changed from wontfix to resolved

    (from [be4ecc2e64cee529922f5cc5a49c56e444e5d869]) check for template with specified extension but without template handler extension [#1798 Render template without TemplateHandler extension state:resolved]

    Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    February 5th, 2009 @ 10:10 PM