<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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>evolving the web...</title>
	<atom:link href="http://blog.kreeti.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.kreeti.com</link>
	<description>discussing various aspects of web design and development</description>
	<pubDate>Thu, 18 Jun 2009 18:51:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>showing session data with exception notification</title>
		<link>http://blog.kreeti.com/rails/showing-session-data-with-exception-notification</link>
		<comments>http://blog.kreeti.com/rails/showing-session-data-with-exception-notification#comments</comments>
		<pubDate>Mon, 15 Jun 2009 09:52:02 +0000</pubDate>
		<dc:creator>Surendra Singhi</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[exception_notification]]></category>

		<category><![CDATA[patch]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://blog.kreeti.com/?p=239</guid>
		<description><![CDATA[We have been using Exception Notification in many of our Rails Project. After upgrading to Rails 2.3 and using our own version of optimized session class, we have noticed that the error emails generated by this plugin were not sending session information. To fix this the below patch can be used.



Index: vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml


===================================================================


&#8212; vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml


+++ vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>We have been using <a href="http://github.com/rails/exception_notification/">Exception Notification</a> in many of our Rails Project. After upgrading to Rails 2.3 and using our own version of optimized session class, we have noticed that the error emails generated by this plugin were not sending session information. To fix this the below patch can be used.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">Index: vendor/plugins/exception_notification/views/exception_notifier/_session.<span class="me1">rhtml</span></div>
</li>
<li class="li1">
<div class="de1">===================================================================</div>
</li>
<li class="li1">
<div class="de1">&#8212; vendor/plugins/exception_notification/views/exception_notifier/_session.<span class="me1">rhtml</span></div>
</li>
<li class="li1">
<div class="de1">+++ vendor/plugins/exception_notification/views/exception_notifier/_session.<span class="me1">rhtml</span>&nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#40;</span>working copy<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">@@ <span class="nu0">-1</span>,<span class="nu0">2</span> <span class="nu0">+1</span>,<span class="nu0">2</span> @@</div>
</li>
<li class="li1">
<div class="de1">-*session id: &lt;%= <span class="re1">@request</span>.<span class="me1">session</span>.<span class="me1">instance_variable_get</span><span class="br0">&#40;</span>:@session_id<span class="br0">&#41;</span>.<span class="me1">inspect</span> %&gt;</div>
</li>
<li class="li1">
<div class="de1">-*data: &lt;%= PP.<span class="me1">pp</span><span class="br0">&#40;</span>@request.<span class="me1">session</span>.<span class="me1">instance_variable_get</span><span class="br0">&#40;</span>:@data<span class="br0">&#41;</span>, <span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>.<span class="kw3">gsub</span><span class="br0">&#40;</span>/\n/, <span class="st0">&quot;<span class="es0">\n</span>  &quot;</span><span class="br0">&#41;</span>.<span class="me1">strip</span> %&gt;</div>
</li>
<li class="li1">
<div class="de1">+*session id: &lt;%= <span class="re1">@request</span>.<span class="me1">session_options</span><span class="br0">&#91;</span><span class="re3">:id</span><span class="br0">&#93;</span>.<span class="me1">inspect</span> %&gt;</div>
</li>
<li class="li1">
<div class="de1">+*data: &lt;%= <span class="re1">@request</span>.<span class="me1">session</span>.<span class="me1">to_hash</span>.<span class="me1">inspect</span>.<span class="me1">to_s</span>.<span class="kw3">gsub</span><span class="br0">&#40;</span>/\n/, <span class="st0">&quot;<span class="es0">\n</span> &nbsp;&quot;</span><span class="br0">&#41;</span>.<span class="me1">strip</span> %&gt;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreeti.com/rails/showing-session-data-with-exception-notification/feed</wfw:commentRss>
		</item>
		<item>
		<title>launching fStation.net</title>
		<link>http://blog.kreeti.com/uncategorized/fstationnet-is-back-again</link>
		<comments>http://blog.kreeti.com/uncategorized/fstationnet-is-back-again#comments</comments>
		<pubDate>Fri, 12 Jun 2009 12:25:57 +0000</pubDate>
		<dc:creator>skarmakar</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[fStation]]></category>

		<category><![CDATA[humor]]></category>

		<category><![CDATA[jokes]]></category>

		<guid isPermaLink="false">http://blog.kreeti.com/?p=232</guid>
		<description><![CDATA[Initially when we started kreeti.com was a web service allowing users to share or browse through jokes, humorous articles, or any fun text. We then decided to reshape ourselves and so have moved everything to a new domain and relaunched the website as fstation.net.  Check it out, and let us know how you like [...]]]></description>
			<content:encoded><![CDATA[<p>Initially when we started <a href="http://www.kreeti.com" target="_blank">kreeti.com</a> was a web service allowing users to share or browse through <a href="http://fstation.net" target="_blank"><strong>jokes, humorous articles, or any fun text</strong></a>. We then decided to reshape ourselves and so have moved everything to a new domain and relaunched the website as <a href="http://fstation.net" target="_blank">fstation.net</a>.  Check it out, and let us know how you like it. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreeti.com/uncategorized/fstationnet-is-back-again/feed</wfw:commentRss>
		</item>
		<item>
		<title>Locally generating rails documentation in mac &#038; linux.</title>
		<link>http://blog.kreeti.com/rails/locally-generating-rails-documentation-in-mac-linux</link>
		<comments>http://blog.kreeti.com/rails/locally-generating-rails-documentation-in-mac-linux#comments</comments>
		<pubDate>Fri, 30 Jan 2009 07:57:08 +0000</pubDate>
		<dc:creator>sdhar</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[documentation]]></category>

		<guid isPermaLink="false">http://blog.kreeti.com/?p=211</guid>
		<description><![CDATA[It is very easy to build a local copy of rails documentation and guides. Open terminal and type these commands.



$ cd /tmp


$ rails doc


$ cd doc


$ rake rails:freeze:gems


$ rake doc:rails 


$ rake doc:guides


$ sudo mv doc /opt/rails-doc



After completing these steps open browser and type



file:///opt/rails-doc/api/index.html //api.


file:///opt/rails-doc/guides/index.html // guide related to rails development.



]]></description>
			<content:encoded><![CDATA[<p>It is very easy to build a local copy of rails documentation and guides. Open terminal and type these commands.
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">$ cd /tmp</div>
</li>
<li class="li1">
<div class="de1">$ rails doc</div>
</li>
<li class="li1">
<div class="de1">$ cd doc</div>
</li>
<li class="li1">
<div class="de1">$ rake rails:freeze:gems</div>
</li>
<li class="li2">
<div class="de2">$ rake doc:rails </div>
</li>
<li class="li1">
<div class="de1">$ rake doc:guides</div>
</li>
<li class="li1">
<div class="de1">$ sudo mv doc /opt/rails-doc</div>
</li>
</ol>
</div>
<p>After completing these steps open browser and type
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">file:///opt/rails-doc/api/index.<span class="me1">html</span> //api.</div>
</li>
<li class="li1">
<div class="de1"><span class="me1">file</span>:///opt/rails-doc/guides/index.<span class="me1">html</span> // guide related to rails development.</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreeti.com/rails/locally-generating-rails-documentation-in-mac-linux/feed</wfw:commentRss>
		</item>
		<item>
		<title>organizing mailers and mailer templates</title>
		<link>http://blog.kreeti.com/rails/organizing-mailers-and-mailer-templates</link>
		<comments>http://blog.kreeti.com/rails/organizing-mailers-and-mailer-templates#comments</comments>
		<pubDate>Sat, 24 Jan 2009 08:26:41 +0000</pubDate>
		<dc:creator>Surendra Singhi</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[action mailer]]></category>

		<category><![CDATA[folder organization]]></category>

		<category><![CDATA[mailers]]></category>

		<guid isPermaLink="false">http://blog.kreeti.com/?p=150</guid>
		<description><![CDATA[When working on a large Rails project, it can be a kludge having the mailers present among the views and other model files. A nice technique to clean up things is to put all the mailers and associated views in the same folder. If you don&#8217;t know about this technique then go read it first, [...]]]></description>
			<content:encoded><![CDATA[<p>When working on a large Rails project, it can be a kludge having the mailers present among the views and other model files. A nice technique to clean up things is to put all the <a href="http://codelevy.com/articles/2008/08/21/organize-your-rails-mailers-and-observers-sweepers-etc">mailers and associated views in the same folder</a>. If you don&#8217;t know about this technique then go read it first, and then come back here.</p>
<p>The benefit of having the <strong>ApplicationMailer</strong> is that you can define the host for the mailers, <em>include ActionController::UrlWriter</em>, other setup methods in a single file and have all the mailers inherit them.</p>
<p>The patch written for <a href="http://blog.kreeti.com/rails/multipart-emails-with-mailer-templates">action mailer to not use layouts for text/plain email</a> was causing problem with <a href="http://github.com/rails/exception_notification/tree/master">exception notification plugin</a>, so I have modified it slightly so that it checks whether the file parameter passed to it responds to content_type or not.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">def</span> candidate_for_layout?<span class="br0">&#40;</span>options<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#40;</span>!options<span class="br0">&#91;</span><span class="re3">:file</span><span class="br0">&#93;</span> || !options<span class="br0">&#91;</span><span class="re3">:file</span><span class="br0">&#93;</span>.<span class="me1">respond_to</span>?<span class="br0">&#40;</span><span class="re3">:content_type</span><span class="br0">&#41;</span> ||</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;options<span class="br0">&#91;</span><span class="re3">:file</span><span class="br0">&#93;</span>.<span class="me1">content_type</span> != <span class="st0">&#8216;text/plain&#8217;</span><span class="br0">&#41;</span> &amp;&amp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;!@template.<span class="me1">send</span><span class="br0">&#40;</span><span class="re3">:_exempt_from_layout</span>?, default_template_name<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">end</span></div>
</li>
</ol>
</div>
<p>Further to clean things up this patch can be moved to <strong>ApplicationMailer</strong> to ensure that it is only applied for all our mailers and not for other mailers which may be used elsewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreeti.com/rails/organizing-mailers-and-mailer-templates/feed</wfw:commentRss>
		</item>
		<item>
		<title>simple search engine optimization steps</title>
		<link>http://blog.kreeti.com/seo/simple-search-engine-optimization-steps</link>
		<comments>http://blog.kreeti.com/seo/simple-search-engine-optimization-steps#comments</comments>
		<pubDate>Fri, 23 Jan 2009 17:50:49 +0000</pubDate>
		<dc:creator>Surendra Singhi</dc:creator>
		
		<category><![CDATA[seo]]></category>

		<category><![CDATA[html]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.kreeti.com/?p=86</guid>
		<description><![CDATA[seo, html, web]]></description>
			<content:encoded><![CDATA[<p>Here are few simple and easy steps which you can take to ensure your website is search engine friendly.</p>
<ol>
<li>Make sure that your page urls are descriptive. For example look at the post urls of this page. They are of the form <em>http://blog.kreeti.com/seo/simple-search-engine-optimization-steps</em>. This is very easy to do in rails. Add the following code to the models:
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"> <span class="kw1">def</span> to_param</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&quot;#{id}-#{name.gsub(/[^a-z0-9]+/i, &#8216;-&#8217;)}&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">end</span></div>
</li>
</ol>
</div>
<p>and then while linking to posts, use code like</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"> user_path<span class="br0">&#40;</span>@user<span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p>and not</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">user_path<span class="br0">&#40;</span>@user.<span class="me1">id</span><span class="br0">&#41;</span> <span class="co1"># do not use this</span></div>
</li>
</ol>
</div>
</li>
<li>Ensure that your pages have a meaningful page title, meta description and meta keywords. Title and description should be preferably unique for each page, and relevant to the page. One simple strategy which you can follow to do this in rails is, in the layout file add the following code:
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;title&gt;&lt;%= @page_title || &quot;Default page title&quot; %&gt;&lt;/title&gt;</div>
</li>
</ol>
</div>
<p>and similarly for meta description and keywords.</p>
<p>Then in your actions you can override the default values</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re1">@page_title</span> = <span class="st0">&quot;New title&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">@page_description</span> = <span class="st0">&quot;new description&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">@meta_keywords</span> = <span class="st0">&quot;keyword1,keyword2,..&quot;</span></div>
</li>
</ol>
</div>
</li>
<li>Make sure that all links to meaningless and duplicate pages have <em>rel=&#8221;nofollow&#8221;</em>. For example, pagination links, links which just sort the page content in a different order, etc., all should have rel=&#8221;nofollow&#8221; for them. This will ensure that the search engines, when propagating the authority of your page to other linked pages, doesn&#8217;t waste them on useless pages, or duplicate links.</li>
<li>When multiple items on a page are linking to the same page, make sure that all the links with irrelevant terms have <em>rel=&#8221;nofollow&#8221;</em>, only the links with terms which aptly describe the page shouldn&#8217;t have <em>rel=&#8221;nofollow&#8221;</em>.</li>
<li> Duplicate versions of your page, say with a different sort order, example a link like <em>/users/recipes?order=created_at</em>, should have
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;meta name=&quot;robots&quot; content=&quot;noindex, noarchive&quot; /&gt;</div>
</li>
</ol>
</div>
<p>in their head element.</li>
<li> Your stylesheets, javascript files, images used for styling purposes, non-important pages like sign in, join, privacy policy, terms, should all not be indexed. To ensure this, create a robots.txt file like the following
<pre># See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
User-Agent: *
Disallow: /account
Disallow: /session
Disallow: /images/
Disallow: /stylesheets/
Disallow: /javascripts/
Disallow: /flash/
Disallow: /opensearch.xml
Disallow: /404.html
Disallow: /500.html

Allow: /</pre>
</li>
</ol>
<p>Sign up for <a href="http://www.google.com/webmasters">Google Webmaster</a> and <a href="https://siteexplorer.search.yahoo.com/">Yahoo Site Explorer</a>, and add your sites to them, and authenticate that your are the owner of it. Both tools provide very valuable information in optimizing a site for search engines.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreeti.com/seo/simple-search-engine-optimization-steps/feed</wfw:commentRss>
		</item>
		<item>
		<title>Rails 2.2.2 - exception notification and spawn plugin</title>
		<link>http://blog.kreeti.com/rails/rails-222-exception-notification-and-spawn-plugin</link>
		<comments>http://blog.kreeti.com/rails/rails-222-exception-notification-and-spawn-plugin#comments</comments>
		<pubDate>Thu, 01 Jan 2009 08:08:43 +0000</pubDate>
		<dc:creator>Surendra Singhi</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[exception notification]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[spawn]]></category>

		<guid isPermaLink="false">http://blog.kreeti.com/?p=136</guid>
		<description><![CDATA[In Rails 2.2.2  the send! method from ActiveSupport has been removed,this broke the exception notification plugin. So, get the latest release from the github.
Also, the introduction of database connection pools breaks the spawn plugin.  So, switch to the latest release of that as well.
]]></description>
			<content:encoded><![CDATA[<p>In Rails 2.2.2  <code>the send!</code> method from ActiveSupport has been removed,this broke the <a href="http://github.com/rails/exception_notification/tree">exception notification plugin</a>. So, get the latest release from the github.</p>
<p>Also, the introduction of <a href="http://ryandaigle.com/articles/2008/9/7/what-s-new-in-edge-rails-connection-pools">database connection pools</a> breaks the <a href="http://github.com/tra/spawn/tree">spawn plugin</a>.  So, switch to the latest release of that as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreeti.com/rails/rails-222-exception-notification-and-spawn-plugin/feed</wfw:commentRss>
		</item>
		<item>
		<title>switch from enhanced migrations plugin to rails timestamped migrations</title>
		<link>http://blog.kreeti.com/rails/switch-from-enhanced-migrations-plugin-to-rails-timestamped-migrations</link>
		<comments>http://blog.kreeti.com/rails/switch-from-enhanced-migrations-plugin-to-rails-timestamped-migrations#comments</comments>
		<pubDate>Sat, 27 Dec 2008 08:14:54 +0000</pubDate>
		<dc:creator>Surendra Singhi</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[migrations]]></category>

		<category><![CDATA[timestamped]]></category>

		<guid isPermaLink="false">http://blog.kreeti.com/?p=82</guid>
		<description><![CDATA[On our rails 1.2.* project we were using enhanced migrations plugin. Recently we decided to make a switch to rails 2.2.* and wanted to use default UTC based migrations versioning which is a part of the rails core now.
Enhanced migrations plugin uses the table migrations_info to store the migrations information but rails 2.2 uses the [...]]]></description>
			<content:encoded><![CDATA[<p>On our rails 1.2.* project we were using <a href="http://revolutiononrails.blogspot.com/2007/11/enhanced-migrations-v120.html">enhanced migrations</a> plugin. Recently we decided to make a switch to rails 2.2.* and wanted to use default <a href="http://ryandaigle.com/articles/2008/4/2/what-s-new-in-edge-rails-utc-based-migration-versioning">UTC based migrations versioning</a> which is a part of the rails core now.</p>
<p>Enhanced migrations plugin uses the table <em>migrations_info</em> to store the migrations information but rails 2.2 uses the table <em>schema_migrations</em> by default. When one does <em>rake db:migrate</em>, the rails code checks whether the <em>schema_migrations</em> table exists or not, if the table is not there, then it is created, and if the <em>schema_info</em> table is present, then this table is populated with all migrations upto the version in the <em>schema_info</em> table. But, since we were using the enhanced migrations plugin, the table <em>schema_info</em> was present but wasn&#8217;t being used.</p>
<p>So, to make the switch to rails 2.2.* timestamped migrations before doing regular <em>rake db:migrate</em> the following sql code had to be run, to ensure that schema_migrations table is pre-created, and has the correct list of all migrations which have been run.</p>
<pre lang='sql'>
create table schema_migrations (version varchar(255) not null primary key);
INSERT INTO schema_migrations select id from migrations_info;
drop table if exists schema_info;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreeti.com/rails/switch-from-enhanced-migrations-plugin-to-rails-timestamped-migrations/feed</wfw:commentRss>
		</item>
		<item>
		<title>multipart emails with mailer templates</title>
		<link>http://blog.kreeti.com/rails/multipart-emails-with-mailer-templates</link>
		<comments>http://blog.kreeti.com/rails/multipart-emails-with-mailer-templates#comments</comments>
		<pubDate>Tue, 23 Dec 2008 09:25:16 +0000</pubDate>
		<dc:creator>Surendra Singhi</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[action mailer]]></category>

		<category><![CDATA[emails]]></category>

		<guid isPermaLink="false">http://blog.kreeti.com/?p=24</guid>
		<description><![CDATA[Rails 2.2 has added a very cool new feature which allows the use of layouts for mailer-templates. But there is one gotcha, when you try sending a multi-part email, both text and html, it wraps the mail content with the same layout for both the text/plain and the text/html version.]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong><em/> The code given below here causes the <a href="http://github.com/rails/exception_notification/tree/master">exception notification</a> plugin to stop working, <a href="http://blog.kreeti.com/rails/organizing-mailers-and-mailer-templates">get the fixed code from this post</a>. It also contains a better technique to organize the mailers.</em><br />
<br/></p>
<p>Rails 2.2 has added a very cool new feature which allows the <a href="http://ryandaigle.com/articles/2008/9/7/what-s-new-in-edge-rails-mailer-layouts">use of layouts for mailer-templates</a>, just like the way layouts can be used for views. This is great, but there is one gotcha, when you try sending a multi-part email (both text and html, as you should be), it wraps the mail content with the same layout for both the text/plain version and the text/html version.</p>
<p>After digging around a bit in the ActionMailer code, I came up with the following monkey patch, which will use the layout <strong>only</strong> for the text/html version of the email. You can put this code in your environment.rb file, it won&#8217;t use layout when the mail-template content type is &#8216;text/plain&#8217;.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co1"># monkey patch action mailer to not use layouts for text/plain emails</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">module</span> ActionMailer</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">class</span> Base</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; private</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">def</span> candidate_for_layout?<span class="br0">&#40;</span>options<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span>!options<span class="br0">&#91;</span><span class="re3">:file</span><span class="br0">&#93;</span> || options<span class="br0">&#91;</span><span class="re3">:file</span><span class="br0">&#93;</span>.<span class="me1">content_type</span> != <span class="st0">&#8216;text/plain&#8217;</span><span class="br0">&#41;</span> &amp;&amp; !@template.<span class="me1">send</span><span class="br0">&#40;</span><span class="re3">:_exempt_from_layout</span>?, default_template_name<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">end</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">end</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">end</span></div>
</li>
</ol>
</div>
<p>If you can come up with some other better solution than this, then let us know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreeti.com/rails/multipart-emails-with-mailer-templates/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

