<?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>jonathanjulian.com</title>
	<atom:link href="http://jonathanjulian.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanjulian.com</link>
	<description>ruby, rails, software</description>
	<pubDate>Fri, 12 Jun 2009 15:09:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tweeting from RubyNation</title>
		<link>http://jonathanjulian.com/2009/06/tweeting-from-rubynation/</link>
		<comments>http://jonathanjulian.com/2009/06/tweeting-from-rubynation/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 15:09:38 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=58</guid>
		<description><![CDATA[I&#8217;m posting updates from RubyNation 2009 on Twitter. Follow along with this search.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m posting updates from <a href="http://rubynation.org">RubyNation</a> 2009 on Twitter. Follow along with <a href="http://search.twitter.com/search?q=rubynation+jonathanjulian">this search</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/06/tweeting-from-rubynation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ExtJS 2.2 JsonStore, HttyProxy method is case-sensitive</title>
		<link>http://jonathanjulian.com/2009/06/extjs-22-jsonstore-httyproxy-method-is-case-sensitive/</link>
		<comments>http://jonathanjulian.com/2009/06/extjs-22-jsonstore-httyproxy-method-is-case-sensitive/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 14:09:54 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[extjs]]></category>

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

		<guid isPermaLink="false">http://jonathanjulian.com/2009/06/extjs-22-jsonstore-httyproxy-method-is-case-sensitive/</guid>
		<description><![CDATA[When overriding the HTTP method from post to get on your JsonStore, the method name is case sensitive. It must be capitalized.

var store = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({url: '/data', method: 'GET'})
});

Using method: &#8216;get&#8217; does not work - it will still be an http post. This is clearly stated in the docs, but it&#8217;s too bad [...]]]></description>
			<content:encoded><![CDATA[<p>When overriding the HTTP method from post to get on your JsonStore, the method name is case sensitive. It must be capitalized.<br />
<code><br />
var store = new Ext.data.JsonStore({<br />
proxy: new Ext.data.HttpProxy({url: '/data', method: 'GET'})<br />
});<br />
</code><br />
Using method: &#8216;get&#8217; does not work - it will still be an http post. This is <a title="screen capture of ext docs" href="&lt;img src=&quot;http://farm4.static.flickr.com/3624/3591811017_09796efff1_o.png&quot;/&gt;">clearly stated in the docs</a>, but it&#8217;s too bad it&#8217;s case-sensitive.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/06/extjs-22-jsonstore-httyproxy-method-is-case-sensitive/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Embedding Flash in an ExtJS component</title>
		<link>http://jonathanjulian.com/2009/04/embedding-flash-in-an-extjs-component/</link>
		<comments>http://jonathanjulian.com/2009/04/embedding-flash-in-an-extjs-component/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 04:18:53 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[extjs]]></category>

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

		<guid isPermaLink="false">http://jonathanjulian.com/?p=43</guid>
		<description><![CDATA[ExtJS does not like it when your code uses document.write. Whatever you write blows away the entire Viewport and that&#8217;s all you see. So as I&#8217;m converting a client&#8217;s existing site into Ext controls, I bump into this when I try to put a Flash swf into an Ext.Panel.
Boom. When the panel with the Flash [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://extjs.com/">ExtJS</a> does not like it when your code uses <strong>document.write</strong>. Whatever you write blows away the entire Viewport and that&#8217;s all you see. So as I&#8217;m converting a client&#8217;s existing site into Ext controls, I bump into this when I try to put a Flash swf into an Ext.Panel.</p>
<p>Boom. When the panel with the Flash is rendered, it takes over the entire page. Not <em>quite</em> what I want it to do.</p>
<p>So I see the Flash is being created in js code, using something called AC_FL_RunContent(). It&#8217;s from the <a href="http://www.adobe.com/products/flashplayer/download/detection_kit/">Adobe Flash Player Detection Kit</a> - a handy javascript library that will render cross-browser html to show your movie. Using&#8230;document.write! Yow!</p>
<p>So a bit of <a href="http://www.google.com/search?q=extjs+flash&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a">googling</a> turns up only a few forum posts discussing how to render Flash inside of Ext components. One popular solution is to use the <a href="http://code.google.com/p/uxmedia/">uxmedia</a> Ext extension&#8230;but it&#8217;s not open source for <a href="http://licensing.theactivegroup.com/">commercial use</a>. And in addition, I don&#8217;t need a pretty way to invoke my Flash, I just need the existing Web 1.0 way to <em>just work</em> inside an Ext component.</p>
<p>So, time for a little hackery. The Flash Player Detection Kit includes the helpful file AC_OETags.js, which is what you would include with your webapp. You call the javascript function AC_FL_RunContent(), passing a bunch of arguments. So here&#8217;s the simple hack: instead of <strong>document.write</strong>-ing the string, change the code to <strong>return</strong> that string to you. Make AC_Generateobj return the str, and make AC_FL_RunContent return the results.</p>
<p>Now in your client code, capture the html:</p>
<pre>var flash_object_markup = AC_FL_RunContent(.......);</pre>
<p>And then render it into a div using a Panel.</p>
<pre>// assuming &lt;div id="flash_content"&gt;&lt;/div&gt;
var content = new Ext.Panel({
  html: flash_object_markup
});
content.render('flash_content');</pre>
<p>And now the flash object is contained and manged by ExtJS.</p>
<p>I&#8217;m sure <strong>hacking the Adobe js file</strong> isn&#8217;t for everyone, but I think it&#8217;s perfectly reasonable. And if you have pre-existing js code that creates Flash html with the Detection Kit, this is a pretty seamless way to get them integrated with ExtJS. And nobody should be using document.write, <em>anyway</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/04/embedding-flash-in-an-extjs-component/feed/</wfw:commentRss>
		</item>
		<item>
		<title>svn revert file.rb == git checkout &#8212; file.rb</title>
		<link>http://jonathanjulian.com/2009/03/svn-revert-filerb-git-checkout-filerb/</link>
		<comments>http://jonathanjulian.com/2009/03/svn-revert-filerb-git-checkout-filerb/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 20:52:02 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[UNIX]]></category>

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

		<guid isPermaLink="false">http://jonathanjulian.com/?p=37</guid>
		<description><![CDATA[You&#8217;ve changed a file, but don&#8217;t want to commit it. Ever. I do this all the time, maybe disabling a filter so I can hit a page with curl, maybe hard-coding a specific user id to test something. In subversion, you would &#8220;revert&#8221; that file.
&#60;code&#62;svn revert file.rb&#60;/code&#62;
In git, you don&#8217;t add that file to your [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve changed a file, but don&#8217;t want to commit it. Ever. I do this all the time, maybe disabling a filter so I can hit a page with curl, maybe hard-coding a specific user id to test something. In subversion, you would &#8220;revert&#8221; that file.</p>
<p>&lt;code&gt;svn revert file.rb&lt;/code&gt;</p>
<p>In git, you don&#8217;t add that file to your staging area for commit. To make your changes go away forever, you checkout a new copy of that file from HEAD.</p>
<p>&lt;code&gt;git checkout &#8212; file.rb&lt;/code&gt;</p>
<p>If you omit the &#8211;, it will still work, as long as you don&#8217;t have a branch named the same as your file. Thanks to <a href="http://norbauer.com/consulting/team">Jonathan Dance</a> at <a href="http://norbauer.com/notebooks/code/notes/git-revert-reset-a-single-file">norbauer.com</a> - one of the few blog entries I found describing this technique.</p>
<p><strong><em>2009-04-28 UPDATE</em></strong> - err has a great <a href="http://cheat.errtheblog.com/s/git/">git cheatsheet</a> that includes this trick under Fixing Mistakes.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/03/svn-revert-filerb-git-checkout-filerb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Removing Rails formatted routes too soon</title>
		<link>http://jonathanjulian.com/2009/03/removing-rails-formatted-routes-too-soon/</link>
		<comments>http://jonathanjulian.com/2009/03/removing-rails-formatted-routes-too-soon/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 18:54:06 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[Rails]]></category>

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

		<guid isPermaLink="false">http://jonathanjulian.com/?p=26</guid>
		<description><![CDATA[Here&#8217;s something to watch out for when serving different types of content using the Rails respond_to and :format parameters. Browsers don&#8217;t always know exactly what to do when serving non-html content. In my app, we serve many pages as csv as well as html.
Since the formatted_ routes are going to be removed from Rails, I [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s something to watch out for when serving different types of content using the Rails respond_to and :format parameters. Browsers don&#8217;t always know exactly what to do when serving non-html content. In my app, we serve many pages as csv as well as html.<br />
Since the <a href="http://ryandaigle.com/articles/2008/11/27/what-s-new-in-edge-rails-no-more-formatted-routes">formatted_ routes are going to be removed</a> <a href="http://rails.lighthouseapp.com/projects/8994/tickets/1359-add-optional-format-argument-to-named-routes">from Rails</a>, I stopped defining them in favor of simply using the :format parameter.</p>
<p><em><strong>This means the url in the browser location bar will NOT end with &#8220;.csv&#8221;. Don&#8217;t do this on Rails 2.2.2 and earlier!<br />
</strong></em></p>
<p>Rails 2.2.2 properly sets the Content-Type to text/csv. But that&#8217;s not enough for our browser to know what to do with it. Poking around this morning reveals that Numbers on my MacBook Pro will not open the csv file without an extension. Same issue reported by QA on Windows with IE and Firefox and Microsoft Excel. Same results whether you let the browser open the file in an app directly, or Save As and then open it.</p>
<p><em><strong>Along with the content-type, the filename and extension needs to be correct.<br />
</strong></em></p>
<p>I fixed this on the server side, by forcing a disposition header the same way send_data does.</p>
<pre>respond_to do |format|
  format.html
  format.csv { headers["Content-Disposition"] ||= "attachment; filename=\"#{params[:action] + '.csv'}\"" }
end</pre>
<p>Now we get a disposition header, which explicitly tells the browser what type of file it is.</p>
<pre>Content-Disposition: attachment; filename="index.csv"</pre>
<p>This is ugly. Don&#8217;t do it. It won&#8217;t be needed when <a href="http://github.com/rails/rails/commit/fef6c32afe2276dffa0347e25808a86e7a101af1">this patch</a>, which removes the formatted_ routes, it released. It seamlessly keeps support for incoming requests such as &#8220;/posts.csv&#8221; working as they should.</p>
<p>So the moral of the story is: <strong>don&#8217;t be overzealous and stop using formatted routes yet!</strong> When you upgrade your app, just remove the formatted routes from routes.rb and everything will continue to work as it should.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/03/removing-rails-formatted-routes-too-soon/feed/</wfw:commentRss>
		</item>
		<item>
		<title>rexml-expansion-fix included in rails 2.2.2</title>
		<link>http://jonathanjulian.com/2008/12/rexml-expansion-fix-included-in-rails-222/</link>
		<comments>http://jonathanjulian.com/2008/12/rexml-expansion-fix-included-in-rails-222/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 06:10:56 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[Rails]]></category>

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

		<guid isPermaLink="false">http://jonathanjulian.com/?p=14</guid>
		<description><![CDATA[The rexml-expansion-fix as noted here and is fixed by a patch or a gem, is included in activesupport-2.2.2. Use this spec to make sure you are patched.
]]></description>
			<content:encoded><![CDATA[<p>The rexml-expansion-fix as noted <a href="http://weblog.rubyonrails.org/2008/8/23/dos-vulnerabilities-in-rexml">here</a> and is fixed by a <a href="http://www.ruby-lang.org/security/20080823rexml/rexml-expansion-fix.rb">patch</a> or a <a href="http://rubyforge.org/frs/?group_id=6869">gem</a>, is <a href="http://github.com/rails/rails/tree/e8577991dcc47bcb11f99fd6582ee2a3f8270498/activesupport/lib/active_support/core_ext/rexml.rb">included</a> in activesupport-2.2.2. Use this <a href="http://gist.github.com/7128">spec</a> to make sure you are patched.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2008/12/rexml-expansion-fix-included-in-rails-222/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rails 2.2 broke my rspec rescue_from</title>
		<link>http://jonathanjulian.com/2008/12/rails-22-broke-my-rspec-rescue_from/</link>
		<comments>http://jonathanjulian.com/2008/12/rails-22-broke-my-rspec-rescue_from/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 20:24:40 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[Rails]]></category>

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

		<guid isPermaLink="false">http://jonathanjulian.com/?p=13</guid>
		<description><![CDATA[When I upgraded to Rails 2.2 and a bunch of my controller tests started failing, I quickly realized that the rescue_from blocks were being skipped. I quick google turned up a solution that I quickly got working.

controller.use_rails_error_handling!

But since none of us wants to have to add this to each of our controller specs, add this [...]]]></description>
			<content:encoded><![CDATA[<p>When I upgraded to Rails 2.2 and a bunch of my controller tests started failing, I quickly realized that the rescue_from blocks were being skipped. I quick google turned up <a href="http://www.undefinedrange.com/2008/12/04/rspec-rails-2-2-neglected-rescue-handlers">a solution</a> that I quickly got working.</p>
<pre>
controller.use_rails_error_handling!
</pre>
<p>But since none of us wants to have to add this to each of our controller specs, add this to your configure block in spec_helper:</p>
<pre>
Spec::Runner.configure do |config|
  config.before(:each, :type=&gt;:controller) {controller.use_rails_error_handling!}
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2008/12/rails-22-broke-my-rspec-rescue_from/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Best ActiveRecord error message ever</title>
		<link>http://jonathanjulian.com/2008/12/best-activerecord-error-message-ever/</link>
		<comments>http://jonathanjulian.com/2008/12/best-activerecord-error-message-ever/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 11:02:04 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[Rails]]></category>

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

		<guid isPermaLink="false">http://jonathanjulian.com/?p=12</guid>
		<description><![CDATA[ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :blocked_client_system or :blocked_client_systems in model GroupsBlkClientSystem.  Try 'has_many :blocked_client_systems, :through =&#62; :groups_blk_client_systems, :source =&#62; &#60;name&#62;'.  Is it one of :group or :client_system?
I was mising :source =&#62; :group from my association. Perfect message. The code knew what was missing, and it told me in a way that could be [...]]]></description>
			<content:encoded><![CDATA[<p><code>ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :blocked_client_system or :blocked_client_systems in model GroupsBlkClientSystem.  Try 'has_many :blocked_client_systems, :through =&gt; :groups_blk_client_systems, :source =&gt; &lt;name&gt;'.  Is it one of :group or :client_system?</code></p>
<p>I was mising :source =&gt; :group from my association. Perfect message. The code knew what was missing, and it told me in a way that could be literally copied and pasted. Do write code like this when you can.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2008/12/best-activerecord-error-message-ever/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Test all the fucking time</title>
		<link>http://jonathanjulian.com/2008/08/test-all-the-fucking-time/</link>
		<comments>http://jonathanjulian.com/2008/08/test-all-the-fucking-time/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 00:10:55 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=11</guid>
		<description><![CDATA[Bryan Liles struck a chord at RubyNation this weekend with his advice for TDD and BDD folks: &#8220;How often should we test?&#8221; &#8220;Test all the fucking time!&#8220;. Luckily, it&#8217;s easy to do.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://smartic.us/">Bryan Liles</a> struck a chord at <a href="http://rubynation.org">RubyNation</a> this weekend with his advice for TDD and BDD folks: &#8220;How often should we test?&#8221; &#8220;<strong>Test all the fucking time!</strong>&#8220;. Luckily, it&#8217;s <a href="http://www.zenspider.com/ZSS/Products/ZenTest/">easy to do</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2008/08/test-all-the-fucking-time/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lots of Rails books coming soon</title>
		<link>http://jonathanjulian.com/2008/07/lots-of-rails-books-coming-soon/</link>
		<comments>http://jonathanjulian.com/2008/07/lots-of-rails-books-coming-soon/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 20:45:38 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=10</guid>
		<description><![CDATA[The people who market technical books pay attention to the &#8220;trends&#8221; in technology. The fall of C and C++. The rise of Ruby / Rails. The rise (and fall) of Java. If us technology people &#8220;watch the watchers&#8221;, we can get a nice warm-and-fuzzy about our current technology choices. For example, look at all the [...]]]></description>
			<content:encoded><![CDATA[<p>The people who market technical books pay attention to the &#8220;trends&#8221; in technology. The fall of C and C++. The rise of Ruby / Rails. The rise (and fall) of Java. If us technology people &#8220;watch the watchers&#8221;, we can get a nice warm-and-fuzzy about our current technology choices. For example, look at all the <a href="http://rubyworld.wordpress.com/2008/07/26/wow-very-huge-list-of-upcoming-rubyrails-books-in-2008/">Ruby and Rails books </a>being published in the coming months!</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2008/07/lots-of-rails-books-coming-soon/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
