<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nobody Listens Anyway</title>
	<atom:link href="http://www.justinball.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justinball.com</link>
	<description>Life is an optimization issue</description>
	<lastBuildDate>Fri, 26 Jun 2009 23:48:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9-rare</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Implicit multipart emails using Ruby on Rails and ActionMailer won&#8217;t work</title>
		<link>http://www.justinball.com/2009/06/26/implicit-multipart-emails-using-ruby-on-rails-and-actionmailer-wont-work/</link>
		<comments>http://www.justinball.com/2009/06/26/implicit-multipart-emails-using-ruby-on-rails-and-actionmailer-wont-work/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 23:48:46 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.justinball.com/2009/06/26/implicit-multipart-emails-using-ruby-on-rails-and-actionmailer-wont-work/</guid>
		<description><![CDATA[I've been beating my head against the wall trying to figure out why html emails from my Rails Engine are sent out as plain text ie the email shows up with all the html tags visible.  Turns out there is an issue in Rails 2.3.2:
https://rails.lighthouseapp.com/projects/8994/tickets/2263-rails-232-breaks-implicit-multipart-actionmailer-tests.  For now I'm just setting my emails to [...]]]></description>
			<content:encoded><![CDATA[<p>I've been beating my head against the wall trying to figure out why html emails from my Rails Engine are sent out as plain text ie the email shows up with all the html tags visible.  Turns out there is an issue in Rails 2.3.2:</p>
<p><a href="https://rails.lighthouseapp.com/projects/8994/tickets/2263-rails-232-breaks-implicit-multipart-actionmailer-tests">https://rails.lighthouseapp.com/projects/8994/tickets/2263-rails-232-breaks-implicit-multipart-actionmailer-tests</a>.  For now I'm just setting my emails to html, but I'm hoping to find either a monkey patch or a Rails update that fixes the issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/06/26/implicit-multipart-emails-using-ruby-on-rails-and-actionmailer-wont-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending email with Ruby on Rails 2.3.2 and gmail</title>
		<link>http://www.justinball.com/2009/06/25/sending-email-with-ruby-on-rails-2-3-2-and-gmail/</link>
		<comments>http://www.justinball.com/2009/06/25/sending-email-with-ruby-on-rails-2-3-2-and-gmail/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 00:04:09 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[2.3.2]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>

		<guid isPermaLink="false">http://www.justinball.com/?p=1068</guid>
		<description><![CDATA[If you need an easy way to setup email for your company or for a client it's hard to not love Google Apps.  (The 'standard' ie free version is here).  
It is very likely that at some point you will need to send out emails from your application.  Don't cry.  Gmail [...]]]></description>
			<content:encoded><![CDATA[<p>If you need an easy way to setup email for your company or for a client it's hard to not love Google Apps.  (<a href="http://www.google.com/apps/intl/en/group/index.html">The 'standard' ie free version is here</a>).  </p>
<p>It is very likely that at some point you will need to send out emails from your application.  Don't cry.  Gmail can do this for you.  Rails 2.3.2 makes it easier than ever with the addition of 'enable_starttls_auto'.  Put the following code in production.rb, development.rb or environment.rb and you 'should' be able to send out emails:</p>
<pre class="ruby">&nbsp;
  <span style="color:#6666ff; font-weight:bold;">ActionMailer::Base</span>.<span style="color:#9900CC;">smtp_settings</span> = <span style="color:#006600; font-weight:bold;">&#123;</span>
    <span style="color:#ff3333; font-weight:bold;">:enable_starttls_auto</span> =&gt; <span style="color:#0000FF; font-weight:bold;">true</span>,
    <span style="color:#ff3333; font-weight:bold;">:address</span>        =&gt; <span style="color:#996600;">'smtp.gmail.com'</span>,
    <span style="color:#ff3333; font-weight:bold;">:port</span>           =&gt; <span style="color:#006666;">587</span>,
    <span style="color:#ff3333; font-weight:bold;">:domain</span>         =&gt; <span style="color:#996600;">'your.domain.com'</span>,
    <span style="color:#ff3333; font-weight:bold;">:authentication</span> =&gt; <span style="color:#ff3333; font-weight:bold;">:plain</span>,
    <span style="color:#ff3333; font-weight:bold;">:user_name</span>      =&gt; <span style="color:#996600;">'login@your.domain.com'</span>,
    <span style="color:#ff3333; font-weight:bold;">:password</span>       =&gt; <span style="color:#996600;">'some_password'</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;</pre>
<p>If you are one of the lucky ones this will actually work.  It didn't work for me but since I still needed to get email working here's what I did:</p>
<p>First be sure to activate the email account that you are using.  To do that you only need to login.  Google will walk you through entering a captcha etc.</p>
<p>You might get this error:<br />
<strong>Net::SMTPAuthenticationError: 530 5.7.0 Must issue a STARTTLS command first.</strong></p>
<p>If you do then check your Ruby version.  <a href="https://rails.lighthouseapp.com/projects/8994/tickets/1336-starttls-for-smtp-makes-gmail-go">Ruby 1.8.7 has this built in but Ruby 1.8.6 does not</a>. </p>
<p>I'm currently running my apps on <a href="http://www.engineyard.com/solo">EngineYard's Solo product <</a>a href="https://cloud-support.engineyard.com/discussions/problems/203-engineyard-cloud-support-for-ruby-187-p73">which is currently using Ruby 1.8.6</a> so changing versions isn't an option (not an easy option anyway).</p>
<p>The next best thing is to <strong>get action_mailer_tls</strong>.  Most of the links you will find in forum and blog posts are broken.  The code is on github and neatly packaged as a gem: <a href="http://github.com/openrain/action_mailer_tls/tree/master">http://github.com/openrain/action_mailer_tls/tree/master</a>.  Follow the directions to install and configure the plugin there and you should be able to send email.</p>
<p>Here's a couple of handy conversations for reference:<br />
<a href="http://www.railsforum.com/viewtopic.php?id=28480">http://www.railsforum.com/viewtopic.php?id=28480</a><br />
<a href="http://www.ruby-forum.com/topic/184137">http://www.ruby-forum.com/topic/184137</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/06/25/sending-email-with-ruby-on-rails-2-3-2-and-gmail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jeweler and the empty gemspec</title>
		<link>http://www.justinball.com/2009/06/24/jeweler-and-the-empty-gemspec/</link>
		<comments>http://www.justinball.com/2009/06/24/jeweler-and-the-empty-gemspec/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 09:21:42 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[jeweler]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.justinball.com/2009/06/24/jeweler-and-the-empty-gemspec/</guid>
		<description><![CDATA[I've been racking my brain trying to figure out why my gemspec for a new gem had no files in it.  I'm using jeweler to build the gem and it's worked great in the past.  Then I read in the docs that jeweler will include any files in the gemspec that are not [...]]]></description>
			<content:encoded><![CDATA[<p>I've been racking my brain trying to figure out why my gemspec for a new gem had no files in it.  I'm using jeweler to build the gem and it's worked great in the past.  Then I read in the docs that jeweler will include any files in the gemspec that are not in .gitignore and it occurs to me that jeweler is getting the list of files from git.  That means you have to do 'git init' and 'git add .' in order to have any files in your project.</p>
<p>So the next time you are building a gem and you do this:</p>
<pre class="ruby">&nbsp;
    gemspec.<span style="color:#9900CC;">files</span>.<span style="color:#9966CC; font-weight:bold;">include</span> %w<span style="color:#006600; font-weight:bold;">&#40;</span>
                            tasks/*
                            db/migrate/*.<span style="color:#9900CC;">rb</span>
                            app/**/**/**/*
                            config/*
                            locales/*
                            rails/*
                            test/*
                            lib/**/*
                            public/**/* <span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;</pre>
<p>and you get this:</p>
<pre class="ruby">&nbsp;
undefined method <span style="color:#996600;">`include' for []:Array
</span></pre>
<p>Just know that your gemspec doesn't contain any files and you don't actually need the include listed above in your Rakefile.  Instead you just need to add all your files to git.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/06/24/jeweler-and-the-empty-gemspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Uploader Gem</title>
		<link>http://www.justinball.com/2009/06/20/new-uploader-gem/</link>
		<comments>http://www.justinball.com/2009/06/20/new-uploader-gem/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 00:01:41 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[uploads]]></category>

		<guid isPermaLink="false">http://www.justinball.com/2009/06/20/new-uploader-gem/</guid>
		<description><![CDATA[I just pushed out a new uploader gem.  Get the new code from github or install the gem with sudo gem install uploader.  This comes with a few more translations and a fix for a nasty bug.  The format was not properly set for uploads via swfupload.  Unfortunately, even without the [...]]]></description>
			<content:encoded><![CDATA[<p>I just pushed out a new uploader gem.  <a href="http://github.com/jbasdf/uploader/tree/master">Get the new code from github</a> or install the gem with sudo gem install uploader.  This comes with a few more translations and a fix for a nasty bug.  The format was not properly set for uploads via swfupload.  Unfortunately, even without the format it worked on uploads from my laptop, but not really for anyone else.  I really hate that.  At any rate it's fixed now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/06/20/new-uploader-gem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Rails Engine Gems</title>
		<link>http://www.justinball.com/2009/06/16/testing-rails-engine-gems/</link>
		<comments>http://www.justinball.com/2009/06/16/testing-rails-engine-gems/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 06:13:41 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[engines testing]]></category>
		<category><![CDATA[gems]]></category>

		<guid isPermaLink="false">http://www.justinball.com/?p=1044</guid>
		<description><![CDATA[I've been working on a number of gems that are basically packaged Ruby on Rails engine plugins.  It turns out that turning gems into plugins is pretty easy to do.  However, testing them can be a pain.  Here are a few things I came up with.
After looking at how Clearance handles tests [...]]]></description>
			<content:encoded><![CDATA[<p>I've been working on a number of gems that are basically packaged Ruby on Rails engine plugins.  It turns out that turning gems into plugins is pretty easy to do.  However, testing them can be a pain.  Here are a few things I came up with.</p>
<p>After looking at how <a href="http://giantrobots.thoughtbot.com/2009/2/9/clearance-rails-authentication-for-developers-who-write-tests">Clearance</a> handles tests I've decided that it's ok to embed a basic Rails application in your test directory.</p>
<p>The next trick is getting the gem you are working on to load in your embedded Rails application.  The Clearance guys added a file in config/initializers that looks like this:</p>
<pre class="ruby">&nbsp;
<span style="color:#008000; font-style:italic;"># This simulates loading the clearance gem, but without relying on</span>
<span style="color:#008000; font-style:italic;"># vendor/gems</span>
&nbsp;
clearance_path = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span>, *%w<span style="color:#006600; font-weight:bold;">&#40;</span>.. .. .. ..<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
clearance_lib_path = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>clearance_path, <span style="color:#996600;">&quot;lib&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$LOAD_PATH</span>.<span style="color:#9900CC;">unshift</span><span style="color:#006600; font-weight:bold;">&#40;</span>clearance_lib_path<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>clearance_path, <span style="color:#996600;">'rails'</span>, <span style="color:#996600;">'init.rb'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;</pre>
<p>I thought that was brilliant but it didn't work for me.  After messing around in the Rails code for a bit I found a bit of helpful documentation on 'plugin_locators':</p>
<p><i><br />
The classes that handle finding the desired plugins that you‘d like to load for your application. By default it is the Rails::Plugin::FileSystemLocator which finds plugins to load in vendor/plugins. You can hook into gem location by subclassing Rails::Plugin::Locator and adding it onto the list of plugin_locators.<br />
</i></p>
<p>That sounded like the perfect solution to my problem.  I figured I would simply add a plugin locator that pointed to the root of the gem I was building.  Turns out that works great.  In the embedded rails application inside of config/environment.rb I added this code:</p>
<pre class="ruby">&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> TestGemLocator &lt; <span style="color:#6666ff; font-weight:bold;">Rails::Plugin::Locator</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> plugins
    <span style="color:#6666ff; font-weight:bold;">Rails::Plugin</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span>, *%w<span style="color:#006600; font-weight:bold;">&#40;</span>.. .. ..<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">Rails::Initializer</span>.<span style="color:#9900CC;">run</span> <span style="color:#9966CC; font-weight:bold;">do</span> |config|
  config.<span style="color:#9900CC;">time_zone</span> = <span style="color:#996600;">'UTC'</span>
  config.<span style="color:#9900CC;">plugin_locators</span> &lt;&lt; TestGemLocator
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;</pre>
<p>Now my tests load correctly and all is well.  Context is important.  If you want to have a look at the full project I put it into a gem called <a href="http://github.com/jbasdf/disguise/tree/master">disguise which you can get from github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/06/16/testing-rails-engine-gems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A copy of ApplicationController has been removed from the module tree but is still active! And can’t dup NilClass</title>
		<link>http://www.justinball.com/2009/06/13/a-copy-of-applicationcontroller-has-been-removed-from-the-module-tree-but-is-still-active-and-can%e2%80%99t-dup-nilclass/</link>
		<comments>http://www.justinball.com/2009/06/13/a-copy-of-applicationcontroller-has-been-removed-from-the-module-tree-but-is-still-active-and-can%e2%80%99t-dup-nilclass/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 01:38:00 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[errors]]></category>

		<guid isPermaLink="false">http://www.justinball.com/2009/06/13/a-copy-of-applicationcontroller-has-been-removed-from-the-module-tree-but-is-still-active-and-can%e2%80%99t-dup-nilclass/</guid>
		<description><![CDATA[If you've been working on Rails 2.3 engines (the new stuff that comes with Rails 2.3 not the old engine plugin) and you start running into either of these errors:

A copy of ApplicationController has been removed from the module tree but is still active!

Or

can’t dup NilClass

Don't go find a new job at McDonald's.  Read [...]]]></description>
			<content:encoded><![CDATA[<p>If you've been working on Rails 2.3 engines (the new stuff that comes with Rails 2.3 not the old engine plugin) and you start running into either of these errors:</p>
<pre>
A copy of ApplicationController has been removed from the module tree but is still active!
</pre>
<p>Or</p>
<pre>
can’t dup NilClass
</pre>
<p>Don't go find a new job at McDonald's.  <a href="http://strd6.com/?p=250">Read this article and feel the love again.</a></p>
<p>In fact if you do any engine or plugin or gem development read that article.  It will make you happy again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/06/13/a-copy-of-applicationcontroller-has-been-removed-from-the-module-tree-but-is-still-active-and-can%e2%80%99t-dup-nilclass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disguise your Rails Application</title>
		<link>http://www.justinball.com/2009/06/12/disguise-your-rails-application/</link>
		<comments>http://www.justinball.com/2009/06/12/disguise-your-rails-application/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 06:30:44 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[disguise]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[theming skin]]></category>

		<guid isPermaLink="false">http://www.justinball.com/?p=1034</guid>
		<description><![CDATA[I spent quite a while trying to figure out how to theme my Ruby on Rails applications.  Turns out after you build a piece of software people want to use it to do other stuff.  Go figure.
I really like how simple it is to skin a Wordpress site so I stole borrowed some [...]]]></description>
			<content:encoded><![CDATA[<p>I spent quite a while trying to figure out how to theme my Ruby on Rails applications.  Turns out after you build a piece of software people want to use it to do other stuff.  Go figure.</p>
<p>I really like how simple it is to skin a Wordpress site so I <del datetime="2009-06-07T05:49:50+00:00">stole</del> borrowed some ideas.</p>
<p>From all of my research and effort and late night I give you disguise the ruby gem that makes it simple to skin your Rails application and impress everyone (ok maybe your mom).</p>
<p>Disguise makes it possible to generate a theme for your Rails website, set the current 'theme' using an admin interface or change the theme based on the current url.</p>
<p>Install the gem:</p>
<pre class="ruby">&nbsp;
  sudo gem install disguise
&nbsp;</pre>
<p>or get the source code at:<br />
<a href="http://github.com/jbasdf/disguise/tree/master">http://github.com/jbasdf/disguise/tree/master</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/06/12/disguise-your-rails-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stupid WTF! ActionView::MissingTemplate Exception: Missing template users/_user.erb</title>
		<link>http://www.justinball.com/2009/06/05/stupid-wtf-actionviewmissingtemplate-exception-missing-template-users_usererb/</link>
		<comments>http://www.justinball.com/2009/06/05/stupid-wtf-actionviewmissingtemplate-exception-missing-template-users_usererb/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 00:12:34 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[ActionView::MissingTemplate]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.justinball.com/?p=1031</guid>
		<description><![CDATA[If you've spent much time working with Ruby on Rails and more especially if you've done anything with json you might have run across errors like this:

ActionView::MissingTemplate Exception: Missing template users/_user.erb

I was having this problem and doing a lot of cursing which is common when I stay up and write code until 2am which I [...]]]></description>
			<content:encoded><![CDATA[<p>If you've spent much time working with Ruby on Rails and more especially if you've done anything with json you might have run across errors like this:</p>
<pre>
ActionView::MissingTemplate Exception: Missing template users/_user.erb
</pre>
<p>I was having this problem and doing a lot of cursing which is common when I stay up and write code until 2am which I know I should do and I also know that I shouldn't write really long run on sentences but I do it anyway.</p>
<p>This error is usually the result of some code that looks like this:</p>
<pre class="ruby">&nbsp;
<span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">json</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#0066ff; font-weight:bold;">@user_html</span> = render_to_string<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#ff3333; font-weight:bold;">:partial</span> =&gt; <span style="color:#996600;">'users/user'</span>, &lt;img src=<span style="color:#996600;">'http://www.justinball.com/wp-includes/images/smilies/icon_surprised.gif'</span> alt=<span style="color:#996600;">':o'</span> <span style="color:#9966CC; font-weight:bold;">class</span>=<span style="color:#996600;">'wp-smiley'</span> /&gt; bject =&gt; <span style="color:#0066ff; font-weight:bold;">@user</span> <span style="color:#006600; font-weight:bold;">&#41;</span>
  render <span style="color:#ff3333; font-weight:bold;">:json</span> =&gt; <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:success</span> =&gt; <span style="color:#0000FF; font-weight:bold;">true</span>,
                              <span style="color:#ff3333; font-weight:bold;">:user_html</span> =&gt; <span style="color:#0066ff; font-weight:bold;">@user_html</span>  <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;</pre>
<p>The cause of this error is that the format of the current request is :json.  There isn't an _user.json.erb template so Rails tries to find an _user.erb file.  That doesn't exist either and boom you spend the night sounding like a sailor.</p>
<p>Now I don't pretend to be an expert but I have been accused of being a hack.  I solve the problem by changing the template format:</p>
<pre class="ruby">&nbsp;
<span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">json</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#0066ff; font-weight:bold;">@template</span>.<span style="color:#9900CC;">template_format</span> = <span style="color:#ff3333; font-weight:bold;">:html</span>
  <span style="color:#0066ff; font-weight:bold;">@user_html</span> = render_to_string<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#ff3333; font-weight:bold;">:partial</span> =&gt; <span style="color:#996600;">'users/user'</span>, &lt;img src=<span style="color:#996600;">'http://www.justinball.com/wp-includes/images/smilies/icon_surprised.gif'</span> alt=<span style="color:#996600;">':o'</span> <span style="color:#9966CC; font-weight:bold;">class</span>=<span style="color:#996600;">'wp-smiley'</span> /&gt; bject =&gt; <span style="color:#0066ff; font-weight:bold;">@user</span> <span style="color:#006600; font-weight:bold;">&#41;</span>
  render <span style="color:#ff3333; font-weight:bold;">:json</span> =&gt; <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:success</span> =&gt; <span style="color:#0000FF; font-weight:bold;">true</span>,
                              <span style="color:#ff3333; font-weight:bold;">:user_html</span> =&gt; <span style="color:#0066ff; font-weight:bold;">@user_html</span>  <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;</pre>
<p>The key is the addition of:</p>
<pre class="ruby">&nbsp;
  <span style="color:#0066ff; font-weight:bold;">@template</span>.<span style="color:#9900CC;">template_format</span> = <span style="color:#ff3333; font-weight:bold;">:html</span>
&nbsp;</pre>
<p>Don't yell at me if it breaks.  I'm open to better suggestions but for now this does work and now my I can find other reasons to stay up late.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/06/05/stupid-wtf-actionviewmissingtemplate-exception-missing-template-users_usererb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>newgem</title>
		<link>http://www.justinball.com/2009/05/30/newgem/</link>
		<comments>http://www.justinball.com/2009/05/30/newgem/#comments</comments>
		<pubDate>Sat, 30 May 2009 23:20:32 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[babelphish]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[newgem]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.justinball.com/?p=1028</guid>
		<description><![CDATA[I've been using newgem to build Babelphish (translation helper thing).  The docs from the ruby forge site are a bit out of date.  If you use newgem to build anything be sure to look at this post from Dr Nic and pay attention to the options you can pass in.  In particular [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using newgem to build Babelphish (translation helper thing).  The <a href="http://newgem.rubyforge.org/">docs from the ruby forge site</a> are a bit out of date.  If you use newgem to build anything <a href="http://drnicwilliams.com/2008/10/31/newgem-100-all-thanks-to-cucumber/">be sure to look at this post from Dr Nic</a> and pay attention to the options you can pass in.  In particular I noticed that the instructions on the rubyforge site indicate the gem will build a default website.  If you want to do that you need to pass in the -w option.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/05/30/newgem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby gems and &#8220;Couldn&#8217;t get release_id, upload failed?&#8221;</title>
		<link>http://www.justinball.com/2009/05/30/ruby-gems-and-couldnt-get-release_id-upload-failed/</link>
		<comments>http://www.justinball.com/2009/05/30/ruby-gems-and-couldnt-get-release_id-upload-failed/#comments</comments>
		<pubDate>Sat, 30 May 2009 16:06:17 +0000</pubDate>
		<dc:creator>Justin Ball</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[gem rubyforge jeweler]]></category>

		<guid isPermaLink="false">http://www.justinball.com/2009/05/30/ruby-gems-and-couldnt-get-release_id-upload-failed/</guid>
		<description><![CDATA[I've been experimenting with Ruby gems over the past few weeks.  I use a couple of other gems to make the process easier including rubyforge, jeweler and newgem.
Jeweler has a rake task 'rubyforge:release' that uploads your gem for you.  The problem was that it would timeout and give me "Couldn't get release_id, upload [...]]]></description>
			<content:encoded><![CDATA[<p>I've been experimenting with Ruby gems over the past few weeks.  I use a couple of other gems to make the process easier including <a href="http://rubyforge.org/projects/codeforpeople">rubyforge</a>, <a href="http://github.com/technicalpickles/jeweler/tree/master">jeweler</a> and <a href="http://newgem.rubyforge.org/">newgem</a>.</p>
<p>Jeweler has a rake task 'rubyforge:release' that uploads your gem for you.  The problem was that it would timeout and give me "Couldn't get release_id, upload failed?".  I assumed that I had configured something wrong so I tried to upload the file directly to rubyforge.  That didn't work either so I assumed (wrongly) that my project had something wrong with it.  I was about to give up when I decided to check my gem size.  It was 100MB!</p>
<p>Somehow I was packaging the gem inside itself on each release and it had grown into a beast.  So if your release is timing out check your gem size and make sure it isn't going nuts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinball.com/2009/05/30/ruby-gems-and-couldnt-get-release_id-upload-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
