Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9698 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] Render template does not honor exempt_from_layout

Reported by: pezra Assigned to: core
Priority: normal Milestone: 1.x
Component: ActionPack Version: edge
Severity: normal Keywords: exempt_from_layout tiny
Cc:

Description

If you call render using the :template option (e.g. render(:template => 'foo/bar')) the response is generated using a layout even if the format of template should be exempt from layouts

The attached patch fixes the problem and adds a test to prevent regressions

Attachments

render-template-layout-bug.diff (2.1 kB) - added by pezra on 09/26/07 23:06:26.
Makes render template honor exempt_from_layout

Change History

09/26/07 23:06:26 changed by pezra

  • attachment render-template-layout-bug.diff added.

Makes render template honor exempt_from_layout

09/26/07 23:07:51 changed by pezra

  • keywords changed from patch to exempt_from_layout.

09/26/07 23:24:30 changed by pezra

  • keywords changed from exempt_from_layout to exempt_from_layout tiny.

Basically all this patch does is change one line of action_controler/layout.rb so that explicitly specified template paths don't get the controller name prepended to them (they should not because they are suppose to be specified relative to the view directory). The controller name was being prepended, as a directory, and that prevented ActionView from determining the extension of the template because there is not such file. This, in turn, made the lookup in the exempt_from_layout list fail.

Not documentation changes are required as the patch provided the already advertised behavior.

09/30/07 22:59:27 changed by david

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

(In [7701]) Fixed that render template did not honor exempt_from_layout (closes #9698) [pezra]