<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: ActionMailer: Hacking multiple template paths</title>
	<atom:link href="http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/</link>
	<description>A Developer with too little time.</description>
	<lastBuildDate>Tue, 07 Sep 2010 02:38:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Sorrow (Unforgiven.pl)</title>
		<link>http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/comment-page-1/#comment-59867</link>
		<dc:creator>Sorrow (Unforgiven.pl)</dc:creator>
		<pubDate>Tue, 06 Jul 2010 11:29:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=168#comment-59867</guid>
		<description>Thanks for sharing this, but unfortunately it does not work with Rails 2.3.8 - an endless loop is entered, as ActionMailer::Base.template_root calls self.view_paths.
The workaround is to replace @@view_paths&#124;&#124;=[template_root] with @@view_paths&#124;&#124;=ActionController::Base.view_paths
This fix ends the endless loop, but causes an exception of private view_paths method being called for a subclass. Simply move view_paths (not self.view_paths) outside the private scope. Voila, done.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing this, but unfortunately it does not work with Rails 2.3.8 &#8211; an endless loop is entered, as ActionMailer::Base.template_root calls self.view_paths.<br />
The workaround is to replace @@view_paths||=[template_root] with @@view_paths||=ActionController::Base.view_paths<br />
This fix ends the endless loop, but causes an exception of private view_paths method being called for a subclass. Simply move view_paths (not self.view_paths) outside the private scope. Voila, done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Royal</title>
		<link>http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/comment-page-1/#comment-51218</link>
		<dc:creator>Matt Royal</dc:creator>
		<pubDate>Fri, 06 Nov 2009 18:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=168#comment-51218</guid>
		<description>Thanks for sharing this!  The one problem I&#039;ve run into with this method is that it will remove all helper functionality from ActionMailer (since ActionMailer::Helpers wraps ActionMailer::Base#initialize_template_class).  To keep helpers, overwrite initialize_template_class_without_helpers instead.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing this!  The one problem I&#8217;ve run into with this method is that it will remove all helper functionality from ActionMailer (since ActionMailer::Helpers wraps ActionMailer::Base#initialize_template_class).  To keep helpers, overwrite initialize_template_class_without_helpers instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sprewell</title>
		<link>http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/comment-page-1/#comment-43001</link>
		<dc:creator>sprewell</dc:creator>
		<pubDate>Sun, 01 Feb 2009 21:03:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=168#comment-43001</guid>
		<description>I just had a problem related to this use of templates, where a ruby script that I was using to send periodic emails, outside of rails, stopped working with my host&#039;s upgrade to actionmailer 2.2.2 (with the following error - `create!&#039;: undefined method `[]&#039; for nil:NilClass (NoMethodError) ).  After an hour or so of experimentation, I finally figured out that the only change that was necessary was to add this line to my script

ActionMailer::Base.template_root = &quot;.&quot;

Make sure you add it outside of smtp_settings, as I was blindly doing at first.  Actionmailer will then look for templates in the local path and not finding any, will ignore the templates (you may want to set a different directory than . if your local path has a lot of directories/files as it will actually search the whole local path for templates).</description>
		<content:encoded><![CDATA[<p>I just had a problem related to this use of templates, where a ruby script that I was using to send periodic emails, outside of rails, stopped working with my host&#8217;s upgrade to actionmailer 2.2.2 (with the following error &#8211; `create!&#8217;: undefined method `[]&#8216; for nil:NilClass (NoMethodError) ).  After an hour or so of experimentation, I finally figured out that the only change that was necessary was to add this line to my script</p>
<p>ActionMailer::Base.template_root = &#8220;.&#8221;</p>
<p>Make sure you add it outside of smtp_settings, as I was blindly doing at first.  Actionmailer will then look for templates in the local path and not finding any, will ignore the templates (you may want to set a different directory than . if your local path has a lot of directories/files as it will actually search the whole local path for templates).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: QuirkeyBlog &#187; Blog Archive &#187; ActionMailer: Changing the subject in the template</title>
		<link>http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/comment-page-1/#comment-34145</link>
		<dc:creator>QuirkeyBlog &#187; Blog Archive &#187; ActionMailer: Changing the subject in the template</dc:creator>
		<pubDate>Fri, 29 Aug 2008 13:53:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=168#comment-34145</guid>
		<description>[...]     &#171; ActionMailer: Hacking multiple template paths  [...]</description>
		<content:encoded><![CDATA[<p>[...]     &laquo; ActionMailer: Hacking multiple template paths  [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
