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

Ticket #9879 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] ActionView does not create template source correctly for ActionMailer RXML builder templates

Reported by: jstewart Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

when compiling RXML templates for ActionMailer views, Rails silently fails without a stack trace. It turns out that ActionView::Base.create_template_source is trying to set the content_type on a GGIReponse object via a response method in the controller. Since this is an ActionMailer object, there is no CGIResponse.

I've included a patch that fixes this issue by checking to see if the controller responds to the response method. If not, the content_type is set in the controller itself (which will really be an am object in this case).

There is also a quick test to see if the rxml template is being rendered correctly. Note that is this test is run without patching ActionView::Base.create_template_source, it will fail silently.

Attachments

fix_rxml_template_rendering_for_actionmailer.diff (2.5 kB) - added by jstewart on 10/15/07 20:17:18.

Change History

10/15/07 20:17:18 changed by jstewart

  • attachment fix_rxml_template_rendering_for_actionmailer.diff added.

10/15/07 20:28:43 changed by fcheung

+1. Looks good to me

10/15/07 20:30:52 changed by bitsweat

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

(In [7921]) Fix silent failure of rxml templates. Closes #9879.