<?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>Pillage and Plunder &#187; rails</title>
	<atom:link href="http://pillageandplunder.net/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://pillageandplunder.net</link>
	<description>Viking's programming blog</description>
	<lastBuildDate>Tue, 25 Aug 2009 00:21:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rails Rumble 2009 &#8211; lend.to</title>
		<link>http://pillageandplunder.net/2009/08/rails-rumble-2009-lend-to/</link>
		<comments>http://pillageandplunder.net/2009/08/rails-rumble-2009-lend-to/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 20:44:44 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rumble]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=95</guid>
		<description><![CDATA[This year for Rails Rumble, our team decided to write an app for tracking whom you&#8217;ve loaned your items to:

It was a blast, just like last year.  Having James Pierce as our designer made a huge difference in the quality of our app.
Using Gawker, we recorded time lapse videos of our three sessions.
Session 1:

The [...]]]></description>
			<content:encoded><![CDATA[<p>This year for <a href="http://railsrumble.com">Rails Rumble</a>, our team decided to write an app for tracking whom you&#8217;ve loaned your items to:</p>
<p><a href="http://pillageandplunder.net/wp-content/uploads/2009/08/link-to.png"><img src="http://pillageandplunder.net/wp-content/uploads/2009/08/link-to-300x208.png" alt="link.to" title="link.to" width="300" height="208" class="alignnone size-medium wp-image-96" /></a></p>
<p>It was a blast, just like last year.  Having <a href="http://jpegjames.com">James Pierce</a> as our designer made a huge difference in the quality of our app.</p>
<p>Using <a href="http://gawker.sourceforge.net/Information.html">Gawker</a>, we recorded time lapse videos of our three sessions.</p>
<p><b>Session 1</b>:</p>
<p><object width="400" height="300" ><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.facebook.com/v/554057257992" /><embed src="http://www.facebook.com/v/554057257992" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="300"></embed></object></p>
<p>The fifth person in the video is our co-worker Will, who didn&#8217;t actually code anything for our Rumble app.  He was there to provide some <a href="http://git-scm.org">Git</a> (and morale) support and keep Rumble Helper updated.  So we didn&#8217;t cheat! <img src='http://pillageandplunder.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><b>Session 2</b>:</p>
<p><object width="400" height="300" ><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.facebook.com/v/554151104922" /><embed src="http://www.facebook.com/v/554151104922" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="300"></embed></object></p>
<p>I forgot the timestamps on this one, but it lasted from about 9:30am on Saturday to 5am on Sunday (the last 15 seconds [3 hours or so real time] is dark&#8230; we forgot to turn the camera off).  Ten points if you can spot our friends Ryan and Leah Stufflebam, who dropped off some homemade chili for us.  It was delicious.</p>
<p><b>Session 3:</b></p>
<p><object width="400" height="300" ><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.facebook.com/v/554151309512" /><embed src="http://www.facebook.com/v/554151309512" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="300"></embed></object></p>
<p>The last session!  In total, we got about 8 hours of sleep each, drank like I don&#8217;t know how many cans of soda, ate a buttload of chips and pizza (and chili).  It was a blast.</p>
<p>Go see our app: <b><a href="http://lend.to">lend.to</a></b>, and all the <a href="http://r09.railsrumble.com/snapshots/all.html">other Rumble apps</a> when you get a chance!</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/08/rails-rumble-2009-lend-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rumble Helper</title>
		<link>http://pillageandplunder.net/2009/08/rumble-helper/</link>
		<comments>http://pillageandplunder.net/2009/08/rumble-helper/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 20:08:34 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rumble]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=83</guid>
		<description><![CDATA[After a meeting of our Rails Rumble team the week before the competition, I decided to undertake a little project to keep track of stuff we wanted to get done during the Rumble.  I came up with Rumble Helper:

You can drag and drop items from one bubble to another so you can easily track [...]]]></description>
			<content:encoded><![CDATA[<p>After a meeting of our <a href="http://r09.railsrumble.com/teams/team-shazbot">Rails Rumble team</a> the week before the competition, I decided to undertake a little project to keep track of stuff we wanted to get done during the Rumble.  I came up with <a href="http://rumble-helper.heroku.com">Rumble Helper</a>:</p>
<p><a href="http://pillageandplunder.net/wp-content/uploads/2009/08/screeny.jpg"><img src="http://pillageandplunder.net/wp-content/uploads/2009/08/screeny-thumb.jpg" alt="screeny-thumb" title="screeny-thumb" width="270" height="215" class="alignnone size-full wp-image-86" /></a></p>
<p>You can drag and drop items from one bubble to another so you can easily track what needs to be done.</p>
<p>We used it during the Rumble in combination with SmartBoard:</p>
<p><a href="http://pillageandplunder.net/wp-content/uploads/2009/08/smartboard.jpg"><img src="http://pillageandplunder.net/wp-content/uploads/2009/08/smartboard-300x200.jpg" alt="Rumble Helper on SmartBoard" title="Rumble Helper on SmartBoard" width="300" height="200" class="alignnone size-medium wp-image-88" /></a></p>
<p>It turned out pretty well!  <a href="http://twitter.com/Sutto">Darcy</a> was nice enough to put it up on the Rails Rumble blog before the competition.  At the end, 45 users had signed up (representing 20 different teams) and 327 tasks had been created.  I was happy it got some use. <img src='http://pillageandplunder.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It was a really good warmup for the Rumble.  I worked on it solid from Friday (August 14) to about Thursday (August 20).  There were several things about it that helped having experience with during Rails Rumble itself.</p>
<p>For next year I plan to add more features to it, like the ability to see what other teams are doing (if they made their team public, that is).  There are also some Javascript issues that I need to see if I can take care of.  If you leave the app open for too long, eventually the AJAX calls bloat up Firefox pretty badly.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/08/rumble-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails, PHP, and default check box values</title>
		<link>http://pillageandplunder.net/2009/03/rails-php-and-default-check-box-values/</link>
		<comments>http://pillageandplunder.net/2009/03/rails-php-and-default-check-box-values/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 18:59:34 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=42</guid>
		<description><![CDATA[The HTML specification dictates that unchecked check boxes should not supply a value in a form submission, which can be problematic for applications wishing to set a flag in a database based on an unchecked check box.  Rails gets around this by using a trick in the check_box helper.  It places a hidden [...]]]></description>
			<content:encoded><![CDATA[<p>The HTML specification dictates that unchecked check boxes should not supply a value in a form submission, which can be problematic for applications wishing to set a flag in a database based on an unchecked check box.  Rails gets around this by <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001580">using a trick</a> in the <code>check_box</code> helper.  It places a hidden input tag with the requested default value <b>directly after</b> the check box tag.</p>
<p>The reason this works is because form parameters are sent in the order that they appear.  This means the hidden input value is submitted <i>after</i> the check box value would be, and Rails gives precedence to parameters appearing earlier in the request.</p>
<p>I tried this in PHP, hoping it would behave the same way.  It doesn&#8217;t.  It turns out that PHP overwrites earlier variables in the request with later ones.  This behavior is dictated by the <a href="http://us2.php.net/manual/en/ini.core.php#ini.request-order">request_order</a> directive (as of PHP 5.3.0, which is still in beta at the time of this post).  The fix is simply to place the hidden input tag before the check box tag.</p>
<p>Hopefully this helps someone avoid the moderate pain I went through figuring all this out.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/03/rails-php-and-default-check-box-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View spec names and Autotest</title>
		<link>http://pillageandplunder.net/2008/12/view-spec-names-and-autotest/</link>
		<comments>http://pillageandplunder.net/2008/12/view-spec-names-and-autotest/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 23:05:59 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=24</guid>
		<description><![CDATA[In one of my Rails projects, I have some views that are rendered through ERB and others through HAML.  This makes it annoying to jump to a view&#8217;s spec via rails.vim, since it currently doesn&#8217;t handle custom Rcommand&#8217;s that accept multiple suffixes.
When I asked tpope today about this, he brought up a good point. [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my Rails projects, I have some views that are rendered through ERB and others through HAML.  This makes it annoying to jump to a view&#8217;s spec via <a href="http://rails.vim.tpope.net">rails.vim</a>, since it currently doesn&#8217;t handle custom <code>Rcommand</code>&#8217;s that accept multiple suffixes.</p>
<p>When I asked <a href="http://tpope.net">tpope</a> today about this, he brought up a good point.  Why are view specs associated with an engine type (such as ERB or HAML) by default?  You should be able to convert an ERB view to a HAML view and use the same tests.</p>
<p>Per his tip, I renamed my views from names like <code>new.html.haml_spec.rb</code> to just <code>new.html_spec.rb</code>.  Unfortunately, autotest stopped recognizing the correlation between my views and my view specs.  Putting this in my <code>.autotest</code> file fixed the issue:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Autotest.<span style="color:#9900CC;">add_hook</span> <span style="color:#ff3333; font-weight:bold;">:initialize</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>at<span style="color:#006600; font-weight:bold;">|</span>
  at.<span style="color:#9900CC;">remove_mapping</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">%</span>^app<span style="color:#006600; font-weight:bold;">/</span>views<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">%</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  at.<span style="color:#9900CC;">add_mapping</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">%</span>^app<span style="color:#006600; font-weight:bold;">/</span>views<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">%</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>f, md<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#008000; font-style:italic;"># strip off engine name</span>
    path = md<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#CC0066; font-weight:bold;">sub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>\.<span style="color:#006600; font-weight:bold;">&#40;</span>erb<span style="color:#006600; font-weight:bold;">|</span>haml<span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    at.<span style="color:#9900CC;">files_matching</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">&#123;</span>spec<span style="color:#006600; font-weight:bold;">/</span>views<span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{path}_spec.rb})</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>I hope that helps someone. <img src='http://pillageandplunder.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2008/12/view-spec-names-and-autotest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bandwagon jumping in the Rails community</title>
		<link>http://pillageandplunder.net/2008/11/bandwagon-jumping-in-the-rails-community/</link>
		<comments>http://pillageandplunder.net/2008/11/bandwagon-jumping-in-the-rails-community/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 20:59:35 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[community]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=15</guid>
		<description><![CDATA[Ever since I started using Rails two and a half years ago, there&#8217;s been something that&#8217;s nagged me about the Rails community.  Only recently have I been able to put my finger on it.  I&#8217;m not sure if this applies to all OSS communities or just Rails&#8217;, but it really bugs me.
Everyone&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I started using Rails two and a half years ago, there&#8217;s been something that&#8217;s nagged me about the Rails community.  Only recently have I been able to put my finger on it.  I&#8217;m not sure if this applies to all <acronym title="Open Source Software">OSS</acronym> communities or just Rails&#8217;, but it really bugs me.</p>
<p>Everyone&#8217;s a bandwagon jumper.</p>
<p>Take the whole TextMate movement, for example.  Two years ago, TextMate was <b>the</b> editor for Rails developers.  All of a sudden though, Vim is the new hotness.  Apparently the exodus from TextMate became full blown after Jamis Buck <a href="http://weblog.jamisbuck.org/2008/10/10/coming-home-to-vim">switched back to Vim</a>.  And, poof!  Hard-core TextMaters are suddenly hard-core Vimmers.  Some of them are switching back to Vim, but others are first time Vim users and now think it&#8217;s all the rage.  It bothers me.</p>
<p>The same thing happened with the testing movement.  Rails developers are known for their outspoken opinions about testing.  &#8220;You should test all the effing time.&#8221;  Everyone seemed to latch onto this idea without even thinking about it.  I agree, testing <i>is</i> good, and it helps you write very stable code, but the blind acceptance of things just seems to happen a lot in this community.</p>
<p>Both Vim and unit testing have been around for a while.  It takes a big name in the community to bring them to attention, and then everyone and their mother&#8217;s dog starts doing it.</p>
<p>And then there&#8217;s Git.  Until a year ago, pretty much everyone used Subversion, and then Git comes out of nowhere.  All it takes is a Google video of Linus Torvalds calling Subversion users idiots, and pretty soon after that, you&#8217;re behind the times if you&#8217;re still using SVN for your revision control.  Github has exploded as the place to have your code if you&#8217;re somebody.</p>
<p>It seems like everyone&#8217;s racing to come up with the next big idea that will be adopted by the entire community.  And if someone beats them to it, the next best thing is to latch onto an idea while it&#8217;s young so that they can be one of the few riding the crest of the wave that&#8217;s about to break onto unsuspecting John Q. Programmer.</p>
<p>To be honest, it&#8217;s like high school all over again.  It&#8217;s the rush to be popular.  The only difference now is that the stage is bigger and money is involved.  If some new way of doing things comes up, consider it, and make up your own mind about it.  Don&#8217;t switch just so you can be one of the first to do so.  The tides change so drastically so often it&#8217;s staggering.  If you don&#8217;t keep up, you might be not be in the <i>in crowd</i> anymore, oh noez!1!one!</p>
<p>Of course, everyone is entitled to their own opinion.  This is just the way I view it.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2008/11/bandwagon-jumping-in-the-rails-community/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
