<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Robby on Rails: Tag rubyonrails</title>
    <link>http://www.robbyonrails.com/articles/tag/rubyonrails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>thoughts.sort_by{|t| t[:topic]}.collect </description>
    <item>
      <title>Meet us at RailsConf</title>
      <description>&lt;p&gt;If you&amp;#8217;re coming to Portland for RailsConf or CabooseConf, be sure to introduce yourself (and we&amp;#8217;ll try to do the same). A few of us from &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt; will be attending the conference. I thought that I&amp;#8217;d make it easy to spot us by putting some faces to our names.&lt;/p&gt;


	&lt;p&gt;In corner #1 we have &lt;strong&gt;Alex Malinovich&lt;/strong&gt; who is our Director of Deployment Services. If you have any questions about hosting options, deployment tips, and scaling your Ruby on Rails application.. be sure to tug on his shoulder. I also overheard that he&amp;#8217;ll be giving people discounts on our Boxcar products to those he meets in person.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/robbyrussell/2419611753/" title="Alex by Robby Russell, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2236/2419611753_d829f271d1.jpg" width="500" height="333" alt="Alex" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;small&gt;&lt;strong&gt;Alex Malinovich&lt;/strong&gt;, Director of Deployment Services&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;In corner #2, we have &lt;strong&gt;Andy Delcambre&lt;/strong&gt; who is on our development team. You might remember Andy from his series of &lt;a href="http://andy.delcambre.com/tags/git"&gt;blog posts/tutorials on using Git&lt;/a&gt; and getting &lt;a href="http://andy.delcambre.com/2007/8/17/authenticated-rss-proxy"&gt;Basecamp &lt;span class="caps"&gt;RSS&lt;/span&gt; feeds working in Google Reader&lt;/a&gt; via a Mongrel-based proxy (our team is still using this approach using this after ten months!).&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/robbyrussell/2432834995/" title="Andy by Robby Russell, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2096/2432834995_eb937af274.jpg" width="333" height="500" alt="Andy" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;small&gt;&lt;strong&gt;Andy Delcambre&lt;/strong&gt;, Software Developer&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;In corner #3, we have &lt;strong&gt;Gary Blessington&lt;/strong&gt; who has been leading our design and development team. If you&amp;#8217;re looking for a job working with Ruby on Rails, be sure to introduce yourself to Gary as he&amp;#8217;s hoping to meet up with several applicants who will be in Portland this week.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/robbyrussell/1430587811/" title="IMG_9286 copy.jpg by Robby Russell, on Flickr"&gt;&lt;img src="http://farm2.static.flickr.com/1167/1430587811_36d525cbf8.jpg" width="500" height="333" alt="IMG_9286 copy.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;small&gt;&lt;strong&gt;Gary Blessington&lt;/strong&gt;, Director of Design and Development&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;In corner #4&amp;#8230; is me. I&amp;#8217;m not doing any talks this year so I plan to do wander around stress-free as I&amp;#8217;m not finishing my slides at the last minute or preparing for panel talks. I&amp;#8217;m happy to field questions and exchange stories with you. :-)&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/robbyrussell/518770652/" title="me... by Robby Russell, on Flickr"&gt;&lt;img src="http://farm1.static.flickr.com/250/518770652_61c87e940f.jpg" width="500" height="333" alt="me..." /&gt;&lt;/a&gt;&lt;br /&gt;&lt;small&gt;&lt;strong&gt;Robby Russell&lt;/strong&gt;&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://jobs.rubynow.com/jobs/show/2238"&gt;We are hiring&lt;/a&gt;... so feel free to introduce yourself to any of the faces above.&lt;/p&gt;


	&lt;p&gt;...and most importantly, I hope you have a great time in Portland!&lt;/p&gt;
</description>
      <pubDate>Wed, 28 May 2008 08:46:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b8ddcb74-ffad-4495-974a-d0eeaeffd9d6</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/05/28/meet-us-at-railsconf</link>
      <category>Business</category>
      <category>Ruby on Rails</category>
      <category>PLANET ARGON</category>
      <category>jobs</category>
      <category>rubyonrails</category>
      <category>planetargon</category>
      <category>portland</category>
      <category>railsconf</category>
    </item>
    <item>
      <title>Boxcar on Twitter</title>
      <description>&lt;p&gt;We&amp;#8217;re about to roll out some announcements for &lt;a href="http://railsboxcar.com"&gt;Boxcar&lt;/a&gt;, our professional &lt;span class="caps"&gt;VPS&lt;/span&gt; hosting solution for Ruby on Rails applications. As we roll out these new updates, we&amp;#8217;re going to offer some extra special deals to those who are following us on twitter. :-)&lt;/p&gt;


	&lt;p&gt;If you want in on the action&amp;#8230;&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://twitter.com/boxcar"&gt;Follow @boxcar&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://twitter.com/planetargon"&gt;Follow @planetargon&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;As usual, we&amp;#8217;ll be posting some announcements on &lt;a href="http://blog.planetargon.com"&gt;our blog&lt;/a&gt; as well&amp;#8230; so be sure to &lt;a href="http://feeds.feedburner.com/planetargon"&gt;subscribe to our feed&lt;/a&gt;.&lt;/p&gt;
</description>
      <pubDate>Thu, 22 May 2008 22:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:267bd0cf-1120-4a35-996c-7a4590b6c2b7</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/05/22/boxcar-on-twitter</link>
      <category>Business</category>
      <category>Ruby on Rails</category>
      <category>PLANET ARGON</category>
      <category>hosting</category>
      <category>vps</category>
      <category>rails</category>
      <category>boxcar</category>
      <category>rubyonrails</category>
      <category>railsboxcar</category>
      <category>twitter</category>
    </item>
    <item>
      <title>Boxcar Conductor: Rails deployment made easy</title>
      <description>&lt;p&gt;In a &lt;a href="http://www.robbyonrails.com/articles/2008/02/28/deploying-rails-with-an-interactive-capistrano-recipe-to-your-boxcar"&gt;previous post&lt;/a&gt;, I showed how we&amp;#8217;ve been working on an interactive deployment process for Rails applications to reduce the time it takes to deploy to a &lt;a href="http://railsboxcar.com"&gt;Boxcar&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;We began to move our Boxcar deployment recipes into it&amp;#8217;s own Rails plugin and just made it available on &lt;a href="http://github.coms"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;


	&lt;h2&gt;Introducing Boxcar Conductor&lt;/h2&gt;


	&lt;p&gt;The &lt;strong&gt;Boxcar Conductor plugin&lt;/strong&gt; aims to automate the entire process for deploying to your Boxcar. We&amp;#8217;re down to just a few simple commands to run to get your application up and running. While mileage may vary with other hosting providers, we did want to open up this work to the community and centralize our work with the community of Boxcar customers who have helped us build and test these tools.&lt;/p&gt;


	&lt;h3&gt;Install Boxcar Conductor&lt;/h3&gt;


	&lt;p&gt;If you&amp;#8217;re running on Edge Rails&amp;#8230; you can take advantage of the new support for installing plugins in git repositories.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ ./script/plugin install git://github.com/planetargon/boxcar-conductor.git
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;small&gt;note: If you&amp;#8217;re not using edge rails, you can download a tarball and install the plugin manually.&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;Installing the plugin will add a custom &lt;code&gt;Capfile&lt;/code&gt; and &lt;code&gt;config/deploy.rb&lt;/code&gt;, which has a few things for you to define based on your &lt;a href="http://railsboxcar.com"&gt;Boxcar subscription&lt;/a&gt;.&lt;/p&gt;


	&lt;h3&gt;Configure Your Boxcar&lt;/h3&gt;


	&lt;p&gt;Once the plugin is installed, you can run the following task:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ cap boxcar:config
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This will ask you a few questions about your deployment needs.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/bsx8/default"&gt;&lt;img src="http://img.skitch.com/20080415-x5rksmf1b7dkx1x57spsr9rwr9.preview.jpg" alt="Default" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt;

	&lt;ul&gt;
	&lt;li&gt;Which database server will you be using? (along with db user/pass info)&lt;/li&gt;
		&lt;li&gt;How many mongrels should run in your cluster?&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;After a few quick multiple choice answers, you&amp;#8217;re application is ready to be deployed and you can run an Boxcar-specific deployment task.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ cap deploy
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;We&amp;#8217;ve also created a new public project on Lighthouse so that you can submit tickets and ideas to us. With Boxcar, we&amp;#8217;re really aiming to remove as many steps from the deployment process that aren&amp;#8217;t necessary.&lt;/p&gt;


	&lt;p&gt;To follow along, visit the project on &lt;a href="http://planetargon.lighthouseapp.com/projects/9962-boxcar-conductor"&gt;lighthouse&lt;/a&gt; or &lt;a href="http://github.com/planetargon/boxcar-conductor/"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re interested in learning more about &lt;a href="http://railsboxcar.com"&gt;Rails Boxcar&lt;/a&gt;, feel free to &lt;a href="http://planetargon.com/contact.html"&gt;drop us a line&lt;/a&gt;.&lt;/p&gt;


	&lt;h2&gt;Related Posts&lt;/h2&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.robbyonrails.com/articles/2008/02/28/deploying-rails-with-an-interactive-capistrano-recipe-to-your-boxcar"&gt;Deploying Rails with an interactive Capistrano recipe to your Boxcar&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://www.robbyonrails.com/articles/2008/04/14/announcing-cobalt-and-monthly-subscriptions-for-boxcar"&gt;Announcing Cobalt and monthly subscriptions for Boxcar&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
</description>
      <pubDate>Tue, 15 Apr 2008 12:16:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6f009771-e806-48fd-9d6f-a236f85accbc</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/04/15/boxcar-conductor-rails-deployment-made-easy</link>
      <category>Business</category>
      <category>Ruby on Rails</category>
      <category>PLANET ARGON</category>
      <category>deployment</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>boxcar</category>
      <category>planetargon</category>
      <category>capistrano</category>
      <category>git</category>
    </item>
    <item>
      <title>Announcing Cobalt and monthly subscriptions for Boxcar</title>
      <description>&lt;p&gt;We&amp;#8217;ve been designing and developing a new centralized billing platform over the past few months and late last week, we launched it! Along with this new billing platform, we launched another new application, &lt;a href="http://cobalt.planetargon.com"&gt;Cobalt&lt;/a&gt;, which is a new account management and support tool for our hosting customers.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/jxi8/cobalt-account-management"&gt;&lt;img src="http://img.skitch.com/20080414-fifqwjjm6cw5h8da13enma17tb.preview.jpg" alt="Cobalt - account management" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt;

	&lt;p&gt;We&amp;#8217;ll be migrating all of our past customers over to this new system in time, but are initially using it for new &lt;a href="http://railsboxcar.com"&gt;Boxcar&lt;/a&gt; customers.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.railsboxcar.com/img/boxcar_logo_wide.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;ve been building the new system to use &lt;a href="http://www.braintreepaymentsolutions.com/"&gt;Braintree&lt;/a&gt; as our new credit card payment gateway. With this switch, we&amp;#8217;re also &lt;a href="http://blog.planetargon.com/2008/4/10/monthly-pricing-plan-for-rails-boxcar"&gt;introducing monthly subscription rates for Boxcar&lt;/a&gt;, which means that you can try it out month-to-month now.&lt;/p&gt;


	&lt;p&gt;Over the next few weeks/months, we&amp;#8217;ll be announcing several features to Cobalt that will ease your Rails deployment experience.&lt;/p&gt;


	&lt;p&gt;I want to thank all those on my team that helped get these new applications up and running.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re looking for professional &lt;span class="caps"&gt;VPS&lt;/span&gt;-based Rails hosting, hop on our train by &lt;a href="http://cobalt.planetargon.com/signup"&gt;ordering a Boxcar today&lt;/a&gt; for &lt;strong&gt;$99/month&lt;/strong&gt;!&lt;/p&gt;


	&lt;p&gt;For more information, visit &lt;a href="http://railsboxcar.com"&gt;railsboxcar.com&lt;/a&gt; or &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Also, be sure to &lt;a href="http://twitter.com/boxcar"&gt;follow Boxcar&lt;/a&gt; on twitter.&lt;/p&gt;
</description>
      <pubDate>Mon, 14 Apr 2008 10:24:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:583d093a-df18-4580-b288-97d7a7d9e203</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/04/14/announcing-cobalt-and-monthly-subscriptions-for-boxcar</link>
      <category>Business</category>
      <category>Ruby on Rails</category>
      <category>PLANET ARGON</category>
      <category>boxcar</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>hosting</category>
      <category>cobalt</category>
      <category>vps</category>
    </item>
    <item>
      <title>git-svn is a gateway drug</title>
      <description>&lt;p&gt;As we&amp;#8217;re migrating away from Subversion to Git, I&amp;#8217;m having to learn a lot about &lt;code&gt;git-svn&lt;/code&gt;. Andy has &lt;a href="http://andy.delcambre.com/2008/3/4/git-svn-workflow"&gt;posted a few articles&lt;/a&gt; on this topic, but I wanted to share a quick tip that I find myself forgetting.&lt;/p&gt;


	&lt;h2&gt;Working with Subversion branches&lt;/h2&gt;


	&lt;p&gt;While you&amp;#8217;re hopefully already familiar with how great &lt;strong&gt;local branches&lt;/strong&gt; are with Git, you might not know that you can connect local branches to &lt;strong&gt;remote&lt;/strong&gt; branches in your Subversion repository. This allows those of us who are using Git locally to work against Subversion branches.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m going to assume the following:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Your team is using Subversion&lt;/li&gt;
		&lt;li&gt;Your team already has a branch that you&amp;#8217;re working in&lt;/li&gt;
		&lt;li&gt;Your team is following Subversion directory conventions (&lt;code&gt;branches/&lt;/code&gt;, &lt;code&gt;tags/&lt;/code&gt;, and &lt;code&gt;trunk/&lt;/code&gt;)&lt;/li&gt;
		&lt;li&gt;You have Git installed (&lt;em&gt;with &lt;span class="caps"&gt;SVN&lt;/span&gt; extensions&lt;/em&gt;)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Checkout the Subversion project with Git&lt;/h3&gt;


	&lt;p&gt;Please visit Andy&amp;#8217;s tutorial, &lt;a href="http://andy.delcambre.com/2008/3/4/git-svn-workflow"&gt;Git &lt;span class="caps"&gt;SVN&lt;/span&gt; Workflow&lt;/a&gt;, for a more detailed explanation of the following commands.&lt;/p&gt;


	&lt;p&gt;First, we&amp;#8217;ll initialize your new local Git repository with &lt;code&gt;git-svn&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  git svn init -s http://svn.yourdomain.com/repos/project_name
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now, you&amp;#8217;ll change directories to your new Git repository.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  cd project_name
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Let&amp;#8217;s fetch all previous revisions into your local repository&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  git svn fetch
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, once this is done&amp;#8230; you&amp;#8217;re &lt;strong&gt;master&lt;/strong&gt; (local) branch is linked to &lt;code&gt;trunk/&lt;/code&gt;.&lt;/p&gt;


	&lt;h3&gt;Mapping a local repository to a remote branch&lt;/h3&gt;


	&lt;p&gt;Assuming that your team is working in a Subversion branch on the current iteration of work. Our team has a naming convention for branches for each iteration. For example, if we&amp;#8217;re in Iteration 18, we&amp;#8217;ll write this as &lt;span class="caps"&gt;ITER&lt;/span&gt;-018 everywhere (Basecamp, Lighthouse, Subversion, etc&amp;#8230;). At the start of each iteration, we create a new branch with this naming convention.&lt;/p&gt;


	&lt;p&gt;For &lt;code&gt;ITER-018&lt;/code&gt;, the Subversion branch would be located at:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;http://svn.yourdomain.com/repos/project_name/branches/ITER-018&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;If you were to do a &lt;code&gt;git branch -r&lt;/code&gt;, you should see &lt;code&gt;ITER-018&lt;/code&gt; show up in the list. Now, the one thing that wasn&amp;#8217;t clear when I first read the &lt;code&gt;git-svn&lt;/code&gt; documentation was that you can&amp;#8217;t just checkout that branch with one command. In fact, this has tripped me up a few times.&lt;/p&gt;


	&lt;p&gt;First, you&amp;#8217;ll need to checkout a new &lt;em&gt;local&lt;/em&gt; branch. I&amp;#8217;ve opted to come up with my own convention for &lt;em&gt;local branches&lt;/em&gt; and in this case, I&amp;#8217;ll name it &lt;code&gt;iter_018&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  git co -b iter_018
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;So, now I&amp;#8217;m in the iter_018 branch, which is local. I&amp;#8217;m currently still mapped to &lt;code&gt;trunk/&lt;/code&gt;, which isn&amp;#8217;t what we want. However, all we need to do is reset where Git is currently pointed to. We can run &lt;a href="http://andy.delcambre.com/2008/3/12/git-reset-in-depth"&gt;git reset&lt;/a&gt; to point this to the &lt;span class="caps"&gt;ITER&lt;/span&gt;-018 branch.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  git reset --hard ITER-018
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;That&amp;#8217;s it! Now, the local &lt;code&gt;iter_018&lt;/code&gt; branch will point to &lt;code&gt;branches/ITER-018&lt;/code&gt; in your Subversion repository. This will allow you to work with your existing repository branch and still reap the benefits of local Git repositories.&lt;/p&gt;


	&lt;h3&gt;What about master?&lt;/h3&gt;


	&lt;p&gt;Good question. The &lt;code&gt;git reset&lt;/code&gt; command that you ran will &lt;span class="caps"&gt;ONLY&lt;/span&gt; apply that that individual local branch. So, master is &lt;em&gt;still&lt;/em&gt; pointing to &lt;code&gt;trunk/&lt;/code&gt;. This will allow you to have several local branches that map to remote branches.&lt;/p&gt;


	&lt;h2&gt;Next Steps&amp;#8230;&lt;/h2&gt;


	&lt;p&gt;If you&amp;#8217;re working with Git already.. great!&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re working in an environment that using Subversion, &lt;code&gt;git svn&lt;/code&gt; provides you the ability to start exploring Git without making your entire team switchover. Perhaps your a consultant and working for a client that uses Subversion&amp;#8230; no problem!&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;re still using Subversion for past client projects and are considering &lt;a href="http://github.com"&gt;GitHub&lt;/a&gt;, which &lt;a href="http://github.com/blog/40-we-launched"&gt;just launched (to the public) today&lt;/a&gt; for future projects. A few of us are already using GitHub for open source projects.&lt;/p&gt;


	&lt;p&gt;Fun.. I just saw the following tweet pass by as I began to wrap up this post.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/jeh1/rails-on-github"&gt;&lt;img src="http://img.skitch.com/20080411-rgageidq82ak6ij952ppant4u9.preview.jpg" alt="rails on github" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt;

	&lt;p&gt;&lt;a href="http://github.com/rails/"&gt;Check out Rails on GitHub!&lt;/a&gt;&lt;/p&gt;


	&lt;h3&gt;The Gateway Drug&amp;#8230; Git reminds me of Cake&lt;/h3&gt;


&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/g0GxUxKZdHk&amp;#38;hl=en"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/g0GxUxKZdHk&amp;#38;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;

	&lt;h3&gt;Questions?&lt;/h3&gt;


	&lt;p&gt;I know that I glossed over a few things, so feel free to post questions and/or tips for others who are looking to dabble with Git.&lt;/p&gt;


	&lt;p id="fn1"&gt;&lt;sup&gt;1&lt;/sup&gt; You&amp;#8217;ll likely have problems if you don&amp;#8217;t have a Git authors file specified in your git config.&lt;/p&gt;
</description>
      <pubDate>Thu, 10 Apr 2008 22:28:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:cea369ee-eed9-4ec3-a0e9-91421f590dd7</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/04/10/git-svn-is-a-gateway-drug</link>
      <category>Ruby on Rails</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>git</category>
      <category>rubyonrails</category>
      <category>subversion</category>
      <category>github</category>
    </item>
    <item>
      <title>I am forking Rails</title>
      <description>&lt;p&gt;...well, creating a fork on GitHub. ;-)&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/e32x/fork-rails"&gt;&lt;img src="http://img.skitch.com/20080402-7jfqp4wbc4h32q3cwysaincfa.preview.jpg" alt="fork rails" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt;

	&lt;p&gt;It appears that Rails is moving from Subversion to Git!&lt;/p&gt;


	&lt;p&gt;Courtenay posted &lt;a href="http://blog.caboo.se/articles/2008/4/2/it-s-official-rails-moves-to-git"&gt;this&lt;/a&gt; a little while ago.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
git clone git://github.com/rails/rails.git
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Check it out the &lt;a href="http://github.com/rails"&gt;Ruby on Rails project&lt;/a&gt; on GitHub.&lt;/p&gt;


	&lt;p&gt;Start working on your next patch with git&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
git clone git://github.com/rails/rails.git
cd rails
git br -a
git br my_patch
git co my_patch
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This is cool news. :-)&lt;/p&gt;
</description>
      <pubDate>Wed, 02 Apr 2008 15:01:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d06a69ee-8006-480f-92f7-6c0c3f53e9e6</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/04/02/forking-rails</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>git</category>
      <category>rubyonrails</category>
      <category>subversion</category>
      <category>github</category>
    </item>
    <item>
      <title>Managing Required Gems on Rails Projects</title>
      <description>&lt;p&gt;We&amp;#8217;re starting a new project and I&amp;#8217;m finding myself adding things to the code base that we&amp;#8217;ve done in the past&amp;#8230; hence the last few posts. As we&amp;#8217;re doing this, I&amp;#8217;d like to highlight some of the little things that we do on each project to maintain some consistency and in that process reach out to the community for alternative approaches.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m intrigued by the &lt;a href="http://errtheblog.com/posts/50-vendor-everything"&gt;vendor everything&lt;/a&gt; concept, but we haven&amp;#8217;t yet adopted this on any of our projects (yet).&lt;/p&gt;


	&lt;p&gt;What we have been doing is to maintain a &lt;code&gt;REQUIRED_GEMS&lt;/code&gt; file in the root directory of our Rails application.&lt;/p&gt;


	&lt;p&gt;For example:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ cat REQUIRED_GEMS

actionmailer
actionpack
actionwebservice
activerecord
activesupport
cgi_multipart_eof_fix
daemons
fastercsv
fastthread
feedtools
gem_plugin
image_science
mongrel
mongrel_cluster
mysql
rails
rake
RedCloth
Ruby-MemCache
soap4r
uuidtools
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Everybody on the team (designers/developers) knows to look here to make sure they have everything installed when beginning to work on the application.&lt;/p&gt;


	&lt;p&gt;This has worked fairly well from project to project but since we&amp;#8217;re starting a new project, I&amp;#8217;m curious if anybody has some better ways to approach this. Should we look more seriously at the vendor everything approach or are there any alternative approaches?&lt;/p&gt;
</description>
      <pubDate>Wed, 26 Mar 2008 22:27:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1dad9e29-fb50-447c-802d-1a0f6109ff1d</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/26/managing-required-gems-on-rails-projects</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>gems</category>
      <category>rubyonrails</category>
      <category>ruby</category>
      <category>rails</category>
      <category>workflow</category>
      <category>team</category>
      <category>planetargon</category>
      <category>question</category>
      <category>tip</category>
    </item>
    <item>
      <title>Managing SEO-friendly HTML Titles with Rails</title>
      <description>&lt;p&gt;I&amp;#8217;ve seen this come up a few times in the #rubyonrails &lt;span class="caps"&gt;IRC&lt;/span&gt; channel and figured that I&amp;#8217;d post a quick entry for future reference.&lt;/p&gt;


	&lt;h2&gt;Problem: &lt;span class="caps"&gt;HTML&lt;/span&gt; titles&lt;/h2&gt;


	&lt;p&gt;&lt;strong&gt;You want to have a clean way to manage the titles on your &lt;span class="caps"&gt;HTML&lt;/span&gt; pages.&lt;/strong&gt;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
      &amp;lt;title&amp;gt;Robby on Rails &amp;amp;mdash; Article Title Goes Here&amp;lt;/title&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
      ...
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Possible Solution(s):&lt;/p&gt;


	&lt;p&gt;Since the &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; tag is usually declared in your layout, you need to be able to dynamically update this information from almost every action in your application.&lt;/p&gt;


	&lt;p&gt;Here are a few ways that I&amp;#8217;ve seen this handled.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Use a instance variable, which would have a default value and you could override it in any controller action&lt;/li&gt;
		&lt;li&gt;Use the &lt;code&gt;content_for&lt;/code&gt; method to manage it.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;Let&amp;#8217;s take a few minutes to look at these two approaches.&lt;/p&gt;


	&lt;h3&gt;Instance Variable&lt;/h3&gt;


	&lt;p&gt;With the instance variable, you might end up with something like:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/views/layouts/application.html.erb
  &amp;lt;title&amp;gt;Robby on Rails &amp;amp;mdash; &amp;lt;%= @html_title || 'Default text here...' -%&amp;gt;&amp;lt;/title&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Then in a controller action&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/controllers/articles_controller.rb
  def show
    # ...
    @html_title = @article.title
  end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;So, that&amp;#8217;s one way to handle it and is probably a more common way.&lt;/p&gt;


	&lt;h3&gt;The &lt;code&gt;content_for&lt;/code&gt; helper method approach&lt;/h3&gt;


	&lt;p&gt;This solution is very similar (and underneath uses an instance variable).&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;ll use the &lt;a href="http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#M001069"&gt;content_for&lt;/a&gt; and a little &lt;code&gt;yield&lt;/code&gt; action.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/views/layouts/application.html.erb
  &amp;lt;title&amp;gt;Robby on Rails &amp;lt;%= (html_title = yield :html_title) ? html_title : '&amp;amp;mdash; Default text here...' %&amp;gt;&amp;lt;/title&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Then we&amp;#8217;ll create a helper method.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/helpers/application_helper.rb
  def set_html_title(str="")
    unless str.blank?
      content_for :html_title do
       "&amp;amp;mdash; #{str} " 
      end
    end
  end  
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now, instead of defining the &lt;span class="caps"&gt;HTML&lt;/span&gt; &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; value in the controllers, we&amp;#8217;ll just toss this into our html.erb files as necessary.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;% set_html_title(@article.name) -%&amp;gt;
  ... rest of view
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;..and that&amp;#8217;s pretty much it.&lt;/p&gt;


	&lt;h3&gt;Which is the better solution?&lt;/h3&gt;


	&lt;p&gt;This is where we&amp;#8217;ll not find a lot of consensus amongst people. I&amp;#8217;m a fan of the &lt;code&gt;content_for&lt;/code&gt;-based approach and defining the title in views rather than in controller actions. I&amp;#8217;m an advocate of skinny controllers and while I&amp;#8217;m not a big fan of messy views, I believe that there is less overhead in managing this within the View-world.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;d love to hear your thoughts on this. Perhaps you have a more eloquent for managing things like this? Do share. :-)&lt;/p&gt;
</description>
      <pubDate>Wed, 26 Mar 2008 16:41:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:de684f82-efe6-48b6-a6f5-68ea542d72ef</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/26/managing-seo-friendly-html-titles-with-rails</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>html</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>helpers</category>
    </item>
    <item>
      <title>Things (in the Rails world) You Don't Yet Understand</title>
      <description>&lt;p&gt;This is inspired by a recent post by Seth Godin titled, &lt;a href="http://sethgodin.typepad.com/seths_blog/2008/03/things-you-dont.html"&gt;Things you don&amp;#8217;t understand&lt;/a&gt;, where he shared a list of things that he probably could understand if he put your mind to it, but doesn&amp;#8217;t. I decided to post a list of five (5) things in response within the context of Ruby/Rails.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m really interested in various things but am really unable to prioritize them high enough to spend the time to understand them.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;RSpec User Stories&lt;/li&gt;
		&lt;li&gt;Using Selenium with RSpec&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://jquery.com/"&gt;JQuery&lt;/a&gt; (&lt;a href="http://blog.imperialdune.com/"&gt;Graeme&lt;/a&gt; speaks highly of it)&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://code.google.com/p/jsspec/"&gt;JSSpec&lt;/a&gt; (BDD for Javascript)&lt;/li&gt;
		&lt;li&gt;Using the Google Charts &lt;span class="caps"&gt;API&lt;/span&gt; with Rails&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;What about you? What&amp;#8217;s your list of things that you&amp;#8217;d like to understand more about?&lt;/p&gt;
</description>
      <pubDate>Tue, 25 Mar 2008 10:12:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:2ad10b2f-7185-4d43-bc2e-1e881281f1c5</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/25/things-in-the-rails-world-you-dont-yet-understand</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>question</category>
      <category>rspec</category>
      <category>jquery</category>
      <category>javascript</category>
      <category>ruby</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>google</category>
      <category>charts</category>
      <category>godin</category>
    </item>
    <item>
      <title>DRY(a): Year After Year</title>
      <description>&lt;p&gt;I&amp;#8217;m guilty of it. Many of you are likely guilty of it&amp;#8230; and I know that several customers of our &lt;a href="http://www.robbyonrails.com/articles/2007/06/17/audit-your-rails-development-team"&gt;Rails Code Audit and Review service&lt;/a&gt; are guilty of it.&lt;/p&gt;


	&lt;p&gt;How many times have you realized (after a few months has passed) that your Copyright date/year on your web site was no longer current?&lt;/p&gt;


	&lt;p&gt;How many of you had the same problem last year? The year before?&lt;/p&gt;


	&lt;p&gt;Let me share some advice with you all&amp;#8230; &lt;span class="caps"&gt;DRY&lt;/span&gt; (a)!&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Don&amp;#8217;t Repeat Yourself (again)!&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;This is really a simple problem to fix but when we&amp;#8217;re busy tackling bigger problems&amp;#8230; little things like this slip by. Don&amp;#8217;t worry, you&amp;#8217;re not the only one who was reminded by a colleague three months into the year that you forgot to update this.&lt;/p&gt;


	&lt;p&gt;On client projects, we have a handful of helpers that we drop into the application. We&amp;#8217;re starting to extract more of these into plugins and will be releasing those as time permits. It just happened that I found myself looking at yet-another Rails code base this afternoon that was showing 2007 in the footer. An easily forgivable offense.. but if you&amp;#8217;re going to go in there and change it (again), &lt;em&gt;take a moment to do the right thing&lt;/em&gt;. ;-)&lt;/p&gt;


	&lt;p&gt;Our solution at &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt; on client projects is to create a basic view helper that renders the current year. This allows us to do the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;div id="footer"&amp;gt;
    &amp;amp;copy; Copyright &amp;lt;%= current_year -%&amp;gt;. All Rights Reserved.
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The helper code looks like:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # add to application_helper.rb
  module ApplicationHelper
    def current_year
      Time.now.strftime('%Y')
    end
  end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Voila. Not rocket science.. is it?&lt;/p&gt;


	&lt;p&gt;Guess what? I&amp;#8217;m getting really tired of adding this to every Rails project that I touch. So, I bottled this little gem into a new Rails plugin that we&amp;#8217;ll just add to future projects.&lt;/p&gt;


	&lt;h2&gt;Introducing Year after Year&lt;/h2&gt;


	&lt;p&gt;This is really the smallest plugin that I could put together (and it includes specs!)&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;What does it provide you?&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;YearAfterYear will provide you a helper that will render the current year (dynamically)! That&amp;#8217;s right&amp;#8230; just add the plugin to your Rails application and you too can enjoy New Years 2009 without having to have a deployment ready with a one line change from 2008 to 2009!&lt;/p&gt;


	&lt;p&gt;To use.. add the following to any view from within Ruby on Rails.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= current_year -%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Installation&lt;/h3&gt;


	&lt;p&gt;As I&amp;#8217;m using git, you&amp;#8217;ll need to grab this and put it into &lt;code&gt;vendor/plugins&lt;/code&gt;. That&amp;#8217;s it!&lt;/p&gt;


	&lt;p&gt;You can grab it on &lt;a href="http://github.com"&gt;GitHub&lt;/a&gt;!&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://github.com/robbyrussell/year_after_year/"&gt;http://github.com/robbyrussell/year_after_year/&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Bugs / Feature Requests &lt;a href="http://planetargon.lighthouseapp.com/projects/5187-open-source-projects/tickets"&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Happy New Years (8+ months early)!&lt;/p&gt;


	&lt;p&gt;Just a friendly reminder to not forget the small stuff&amp;#8230; because your visitors will notice! ;-)&lt;/p&gt;


	&lt;h3&gt;Updates&amp;#8230;&lt;/h3&gt;


	&lt;p&gt;I got a few requests for this to also provide a range of years for people who like to do: &lt;strong&gt;2005-2007&lt;/strong&gt;. So this is now provided as well.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;year_range(start_year)&lt;/code&gt;&lt;/p&gt;


Example:
&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= year_range(2005) %&amp;gt; # =&amp;gt; 2005-2008
&lt;/code&gt;&lt;/pre&gt;
</description>
      <pubDate>Mon, 24 Mar 2008 22:05:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4228a063-facc-4a13-bdb0-342c0fab415e</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/24/dry-a-year-after-year</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>sarcasm</category>
      <category>plugin</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>years</category>
      <category>copyrights</category>
      <category>joke</category>
      <category>plugins</category>
    </item>
    <item>
      <title>The Argon Express 2008? It's not too late!</title>
      <description>&lt;p&gt;Picture yourself and your laptop. It&amp;#8217;s been over a day and you&amp;#8217;re sitting on a train with a group of Rails developers with a view like this over your shoulder.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/planetargon/172836278/"&gt;&lt;img src="http://farm1.static.flickr.com/58/172836278_971d94bdcf.jpg?v=0" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Hacking and reading on the train.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/planetargon/171979062/"&gt;&lt;img src="http://farm1.static.flickr.com/48/171979062_67b4f36d32.jpg?v=0" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Enjoying the sceneary of the U.S.A.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/planetargon/171147271/in/pool-argonexpress"&gt;&lt;img src="http://farm1.static.flickr.com/72/171147271_327da3ae00.jpg?v=0" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Two years ago&amp;#8230; a group of us went from Portland to Chicago for RailsConf 2006 on the &lt;a href="http://theargonexpress.com"&gt;Argon Express&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/planetargon/170934210/"&gt;&lt;img src="http://farm1.static.flickr.com/60/170934210_1f1c24fdf1.jpg?v=0" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I know this is a tad late&amp;#8230; but uf you haven&amp;#8217;t purchased plane tickets to Portland yet for CabooseConf or RailsConf 2008 and would be interested in catching the train from somewhere the East Coast, &lt;a href="mailto:robbyrussell+argonexpress@gmail.com"&gt;email me&lt;/a&gt; and we&amp;#8217;ll talk. I&amp;#8217;m hoping to organize the Argon Express 2008 over next few weeks.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jeremyhubert/174669916/"&gt;&lt;img src="http://farm1.static.flickr.com/45/174669916_e117fb56b8.jpg?v=0" /&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <pubDate>Wed, 05 Mar 2008 18:39:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:44f449d6-32ae-45c8-9a12-581bdc84a5c1</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/05/the-argon-express-2008-its-not-too-late</link>
      <category>Ruby on Rails</category>
      <category>PLANET ARGON</category>
      <category>argonexpress</category>
      <category>train</category>
      <category>railsconf</category>
      <category>caboose</category>
      <category>cabooseconf</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>agile</category>
    </item>
    <item>
      <title>Installing Ruby on Rails and PostgreSQL on OS X, Third Edition</title>
      <description>&lt;p&gt;Over the past few years, I&amp;#8217;ve helped you walk through the process of getting Ruby on Rails up and running on Mac &lt;span class="caps"&gt;OS X&lt;/span&gt;. The last version has been getting a lot of comments related to issues with the new Apple Leopard, so I&amp;#8217;m going this post will expand on previous installation guides with what&amp;#8217;s working for me as of January 2008.&lt;/p&gt;


	&lt;p&gt;The following guide is how our development team at &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt; prefers to setup our development workstations&lt;/p&gt;


	&lt;p&gt;During this installation, we&amp;#8217;ll have what we feel is the optimal development stack for building &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt; applications with our favorite database server, &lt;a href="http://postgresql.org"&gt;PostgreSQL&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Ready? Let&amp;#8217;s get started&amp;#8230;&lt;/p&gt;
&lt;h2&gt;Phase One&lt;/h2&gt;


	&lt;p&gt;During this initial phase, we&amp;#8217;re going to install the underlying dependencies that we&amp;#8217;ll be building off of.&lt;/p&gt;


	&lt;h3&gt;XCode 3.0&lt;/h3&gt;


	&lt;p&gt;The first thing that you&amp;#8217;ll need to install to get far with this process is XCode tools, which is distributed by Apple. You can find this on the &lt;span class="caps"&gt;DVD&lt;/span&gt; that your Leopard installer is on. You can also download the latest version from Apple&amp;#8217;s developer site.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://developer.apple.com/tools/download/"&gt;http://developer.apple.com/tools/download/&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The current version (3.0) is 1.1 GB.. so the download time will vary depending on your connection speed. I would encourage you to drink some tea and/or &lt;a href="http://www.amazon.com/gp/product/0684868768?ie=UTF8&amp;#38;tag=robonrai-20&amp;#38;linkCode=as2&amp;#38;camp=1789&amp;#38;creative=9325&amp;#38;creativeASIN=0684868768"&gt;read a book&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=robonrai-20&amp;#38;l=as2&amp;#38;o=1&amp;#38;a=0684868768" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;&lt;/p&gt;


	&lt;p&gt;Once you finish the installation, you can move forward. The rest of these installation &lt;strong&gt;will not work&lt;/strong&gt; until XCode is installed. :-)&lt;/p&gt;


	&lt;h3&gt;MacPorts&lt;/h3&gt;


	&lt;p&gt;In this next step, we&amp;#8217;ll install &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; (formerly known as DarwinPorts). The MacPorts web site describes itself as, &lt;em&gt;&amp;#8220;an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, &lt;span class="caps"&gt;X11&lt;/span&gt; or Aqua based open-source software on the Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; operating system.&amp;#8221;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://img.skitch.com/20080122-jxqkyy8hc8ug7qxy4jt6qeg3d1.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;This tool is about to become one of the most important tools on your operating system as it&amp;#8217;ll be used time and time again to maintain your libraries and many of the Unix tools that you&amp;#8217;ll be using. If you’re from the Linux or &lt;span class="caps"&gt;BSD&lt;/span&gt; world, you are likely familiar with similar tools… such as: apt-get, port, and yum.&lt;/p&gt;


	&lt;p&gt;First, you&amp;#8217;ll want to download MacPorts and install the &amp;#8220;dmg&amp;#8221; disk file for Leopard at the following link.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.macports.org/install.php"&gt;http://www.macports.org/install.php&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Once downloaded, you&amp;#8217;ll want to run the installer and install it on your workstation.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdqg/install-macports-1.6.0"&gt;&lt;img src="http://img.skitch.com/20080122-efm4gb9pbb79p4ujya1ceisn37.preview.jpg" alt="Install MacPorts-1.6.0" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;Work you way through the installer until successfully installed.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdqe/install-macports-1.6.0"&gt;&lt;img src="http://img.skitch.com/20080122-rr9e1begkg73ixt11d697wpdfh.preview.jpg" alt="Install MacPorts-1.6.0" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;Once this finishes, you can open up your favorite terminal application and run the following to test that it installed properly.&lt;/p&gt;


	&lt;p&gt;In my case, I&amp;#8217;m now using Terminal.app.&lt;/p&gt;


	&lt;p&gt;Issue the command: &lt;code&gt;/opt/local/bin/port version&lt;/code&gt;&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdqm/opt-local-bin-port-version"&gt;&lt;img src="http://img.skitch.com/20080122-piqes1e66rgj1bui7eud9sisf7.preview.jpg" alt="_opt_local_bin_port version" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;If it responds with a version number like mine did in the screenshot above, we&amp;#8217;re moving along nicely.&lt;/p&gt;


	&lt;h3&gt;Environment Paths&lt;/h3&gt;


	&lt;p&gt;When we install MacPorts, the command to install/update ports installed to &lt;code&gt;/opt/local/bin&lt;/code&gt;. We had to provide the entire path as this isn&amp;#8217;t currently showing up in the default &lt;code&gt;$PATH&lt;/code&gt; on Leopard. Let&amp;#8217;s quickly remedy this by modifying the file &lt;code&gt;/etc/profile&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;If you have Textmate installed, you can run the following from your terminal: &lt;code&gt;mate /etc/profile&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;Add the following line to the bottom of &lt;code&gt;/etc/profile&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;export PATH=/opt/local/bin:/opt/local/sbin:$PATH&lt;/code&gt;&lt;/pre&gt;

&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdxb/profile"&gt;&lt;img src="http://img.skitch.com/20080122-mqk8awqpbeebmdq7p7r1gyixsy.preview.jpg" alt="profile" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;You can use your favorite editor to update this file. Once you save it, you&amp;#8217;ll want to restart your terminal application (or open a new tab) to create a new session. When your new terminal opens, run the following to verify that &lt;code&gt;port&lt;/code&gt; is showing up in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;which port&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;You should see &lt;code&gt;/opt/local/bin/port&lt;/code&gt; show up as the result of this command.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdx8/which-port"&gt;&lt;img src="http://img.skitch.com/20080122-d4hte4cm5gn67a4cum26gbibut.preview.jpg" alt="which port" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;Great, let&amp;#8217;s continue to move forward.&lt;/p&gt;


	&lt;h3&gt;Hiding Apple&amp;#8217;s Ruby, Gems, and Rails&lt;/h3&gt;


	&lt;p&gt;Before we install Ruby from MacPorts, we&amp;#8217;ll go ahead and hide Apple&amp;#8217;s Ruby installations.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
    :~ robbyrussell$ sudo su -
    Password:
    :~ root# mv /usr/bin/ruby /usr/bin/ruby.orig
    :~ root# mv /usr/bin/gem /usr/bin/gem.orig
    :~ root# mv /usr/bin/rails /usr/bin/rails.orig
    :~ root# logout    
&lt;/code&gt;&lt;/pre&gt;

&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdxe/hiding-apples-ruby"&gt;&lt;img src="http://img.skitch.com/20080122-rgmsuy746h73b1bc93j4nyi5ar.preview.jpg" alt="hiding apples ruby" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;If you ever decide to remove MacPorts, you can just rename &lt;code&gt;ruby.orig&lt;/code&gt; back to &lt;code&gt;ruby&lt;/code&gt; and you&amp;#8217;re back where you started&amp;#8230; and the same for the others listed.&lt;/p&gt;


	&lt;h2&gt;Phase Two&lt;/h2&gt;


	&lt;p&gt;During this next phase, we&amp;#8217;re going to install Ruby and Ruby on Rails.&lt;/p&gt;


	&lt;h3&gt;Installing Ruby via MacPorts&lt;/h3&gt;


	&lt;p&gt;Now that we have MacPorts up and running, we&amp;#8217;re going to use it for the first time. We&amp;#8217;ll start by using it to install Ruby and the Rubygems package.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo port install ruby rb-rubygems&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Okay, this will take a little while. I&amp;#8217;d suggest that you step out to get some fresh air.&lt;/p&gt;


	&lt;p&gt;How was it outside? What&amp;#8217;s the weather like there today? It&amp;#8217;s currently 2:30am &lt;span class="caps"&gt;PST&lt;/span&gt; so it&amp;#8217;s dark and an 28F outside so I didn&amp;#8217;t stay outside very long.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re still waiting for it to install, perhaps you could watch the following video. I might encourage you to check out more of &lt;a href="http://en.wikipedia.org/wiki/Jam_%28TV_series%29"&gt;Jam&lt;/a&gt;, which was recommended a few years ago to me by &lt;a href="http://interblah.net/"&gt;James Adam&lt;/a&gt; at &lt;a href="http://www.canadaonrails.org/"&gt;Canada on Rails&lt;/a&gt;.&lt;/p&gt;


&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/sLD0SNCFtyA&amp;#38;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/sLD0SNCFtyA&amp;#38;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;

	&lt;p&gt;Be warned&amp;#8230; it&amp;#8217;s a strange show, but I find strange things like this funny. :-)&lt;/p&gt;


	&lt;p&gt;If you prefer something a bit more lighthearted&amp;#8230;&lt;/p&gt;


&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/SO5WoLnOOlU&amp;#38;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/SO5WoLnOOlU&amp;#38;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;

	&lt;p&gt;Okay&amp;#8230; when Ruby finishes installing, you&amp;#8217;ll want to test that you can run it.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ ruby -v&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, let&amp;#8217;s move forward!&lt;/p&gt;


	&lt;h3&gt;Installing Ruby on Rails via RubyGems&lt;/h3&gt;


	&lt;p&gt;We&amp;#8217;re now going to install the libraries that make up Ruby on Rails via RubyGems.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo gem install --include-dependencies rails&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This will install the following gems.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;rails-2.0.2&lt;/li&gt;
		&lt;li&gt;rake-0.8.1&lt;/li&gt;
		&lt;li&gt;activesupport-2.0.2&lt;/li&gt;
		&lt;li&gt;activerecord-2.0.2&lt;/li&gt;
		&lt;li&gt;actionpack-2.0.2&lt;/li&gt;
		&lt;li&gt;actionmailer-2.0.2&lt;/li&gt;
		&lt;li&gt;activeresource-2.0.2&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Excellent, let&amp;#8217;s move forward&amp;#8230;&lt;/p&gt;


	&lt;p&gt;If you haven&amp;#8217;t already purchased it, I recommend that you take a look at &lt;a href="http://www.amazon.com/gp/product/0321445619?ie=UTF8&amp;#38;tag=robonrai-20&amp;#38;linkCode=as2&amp;#38;camp=1789&amp;#38;creative=9325&amp;#38;creativeASIN=0321445619"&gt;The Rails Way (Addison-Wesley Professional Ruby Series)&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=robonrai-20&amp;#38;l=as2&amp;#38;o=1&amp;#38;a=0321445619" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt; by Obie Fernandez.&lt;/p&gt;


	&lt;h3&gt;Installing Mongrel via RubyGems&lt;/h3&gt;


	&lt;p&gt;Let&amp;#8217;s now install Mongrel, which is an excellent Ruby-based web server for Ruby on Rails applications. We use it in development and production at &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt; and it&amp;#8217;s also what we recommend to our &lt;a href="http://planetargon.com/hosting.html"&gt;hosting customers&lt;/a&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo gem install --include-dependencies mongrel mongrel_cluster&lt;/code&gt;&lt;/pre&gt;

	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Note:&lt;/strong&gt; Be sure to select the proper platform for mongrel. (hint: &lt;span class="caps"&gt;OS X&lt;/span&gt; is &lt;span class="caps"&gt;NOT&lt;/span&gt; mswin32)&lt;/li&gt;
	&lt;/ul&gt;


My terminal output:
&lt;pre&gt;&lt;code&gt;
Select which gem to install for your platform (i686-darwin9.1.0)
 1. mongrel 1.1.3 (java)
 2. mongrel 1.1.3 (i386-mswin32)
 3. mongrel 1.1.3 (ruby)
 4. mongrel 1.1.2 (ruby)
 5. mongrel 1.1.2 (mswin32)
 6. mongrel 1.1.2 (java)
 7. Skip this gem
 8. Cancel installation
&amp;gt; 3
Select which gem to install for your platform (i686-darwin9.1.0)
 1. fastthread 1.0.1 (mswin32)
 2. fastthread 1.0.1 (ruby)
 3. Skip this gem
 4. Cancel installation
&amp;gt; 2
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed mongrel-1.1.3
Successfully installed gem_plugin-0.2.3
Successfully installed daemons-1.0.9
Successfully installed fastthread-1.0.1
Successfully installed cgi_multipart_eof_fix-2.5.0
Installing ri documentation for mongrel-1.1.3...
Installing ri documentation for gem_plugin-0.2.3...
Installing ri documentation for daemons-1.0.9...
Installing ri documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing ri documentation for cgi_multipart_eof_fix-2.5.0...
Installing RDoc documentation for mongrel-1.1.3...
Installing RDoc documentation for gem_plugin-0.2.3...
Installing RDoc documentation for daemons-1.0.9...
Installing RDoc documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing RDoc documentation for cgi_multipart_eof_fix-2.5.0...
Successfully installed mongrel_cluster-1.0.5
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, you have almost all of the essentials.. except a database.&lt;/p&gt;


	&lt;h2&gt;Phase Three&lt;/h2&gt;


	&lt;p&gt;In this phase, we&amp;#8217;re going to get our database server, PostgreSQL, installed and the libraries that Ruby needs to communicate with it.&lt;/p&gt;


	&lt;h3&gt;Installing PosgreSQL with MacPorts&lt;/h3&gt;


	&lt;p&gt;At &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt;, we design and develop our applications on top of &lt;a href="http://postgresql.org"&gt;PostgreSQL&lt;/a&gt;. I’ve been advocating the adoption of this awesome open source database in the Rails community for quite some time now.&lt;/p&gt;


	&lt;p&gt;The current version available of PostgreSQL via MacPorts is 8.3, which is what we&amp;#8217;ll now install with the &lt;code&gt;port&lt;/code&gt; command.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;$ sudo port install postgresql83 postgresql83-server&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;This will download and install the necessary libraries to run PostgreSQL server and the client utilities.&lt;/p&gt;


	&lt;h3&gt;Configuring PostgreSQL&lt;/h3&gt;


	&lt;p&gt;When PostgreSQL is finished installing, it&amp;#8217;ll tell you to run the following commands to create a new database instance.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
 sudo mkdir -p /opt/local/var/db/postgresql83/defaultdb
 sudo chown postgres:postgres /opt/local/var/db/postgresql83/defaultdb
 sudo su postgres -c '/opt/local/lib/postgresql83/bin/initdb -D /opt/local/var/db/postgresql83/defaultdb'
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Adding PostgreSQL to launchd&lt;/h4&gt;


	&lt;p&gt;If you&amp;#8217;d like to have PostgreSQL automatically startup after a system restart, you can load it into launchd, which comes with &lt;span class="caps"&gt;OS X&lt;/span&gt;. By running the following command, PostgreSQL will startup automatically on the next system restart.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Adding PostgreSQL to your $PATH&lt;/h4&gt;


	&lt;p&gt;For some reason, the MacPort for PostgreSQL doesn&amp;#8217;t get the programs in your path automatically, so we&amp;#8217;ll it now.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;mate /etc/profile&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;Modify the &lt;code&gt;PATH&lt;/code&gt; that we changed earlier to include /opt/local/lib/postgresql83/bin@.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql83/bin:$PATH&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Save the file and then open a new terminal. To test this, you should get the following output when you run which &lt;code&gt;psql&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ which psql
  /opt/local/lib/postgresql83/bin/psql    
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Creating a new PostgreSQL user&lt;/h4&gt;


	&lt;p&gt;When I’m working on Rails applications in my development environment, I really don’t want to have to specify a username and password in every &lt;code&gt;config/database.yml&lt;/code&gt; file for each of our ongoing client projects. When PostgreSQL was installed, it created a superuser named &lt;strong&gt;postgres&lt;/strong&gt;, which is great, but I’d like one that matches my system username, so that I’m not prompted at all for a username or password to connect to PostgreSQL.&lt;/p&gt;


	&lt;p&gt;To do this, we’ll use the &lt;code&gt;createuser&lt;/code&gt; command, which comes with PostgreSQL. As you can see, I’m creating a new user with &lt;code&gt;superuser&lt;/code&gt; privileges (and will hopefully be the last time I have to do a &lt;code&gt;-U postgres&lt;/code&gt;).&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ createuser --superuser robbyrussell -U postgres
  CREATE ROLE    
&lt;/code&gt;&lt;/pre&gt;

Let’s take a quick moment to test this out.
&lt;pre&gt;&lt;code&gt;
  # create a new database
  $ createdb my_test_db
  CREATE DATABASE

  # drop the database
  $ dropdb my_test_db
  DROP DATABASE
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, everything looks good here.&lt;/p&gt;


	&lt;p&gt;We now have a running installation of PostgreSQL with a new user account. All we need to do now is install the appropriate RubyGem to allow our Ruby applications to connect to it.&lt;/p&gt;


	&lt;h4&gt;Installing PostgreSQL Libraries for Ruby&lt;/h4&gt;


	&lt;p&gt;You can install postgres gem by running the following command.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$  sudo gem install --include-dependencies postgres&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great. We’ve now built a professional development environment for working with Ruby on Rails. Can you &lt;em&gt;feel&lt;/em&gt; the excitement? :-)&lt;/p&gt;


	&lt;h2&gt;Closing Thoughts&lt;/h2&gt;


	&lt;p&gt;Like the previous versions, I hope that a few people find this useful. I didn&amp;#8217;t have to make a lot of changes from the second edition, but there were enough to warrant a new post. I&amp;#8217;ve been setting up my workstation like this for about three years now and I&amp;#8217;m looking forward to seeing how a fresh install on Leopard works out for me.&lt;/p&gt;


	&lt;p&gt;If you have any problems, feel free to ask a question in the comments below.&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jan 2008 11:55:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:73dcd126-1333-417e-9203-aaefb22a65b1</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>PostgreSQL</category>
      <category>PLANET ARGON</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>postgresql</category>
      <category>xcode</category>
      <category>apple</category>
      <category>osx</category>
      <category>macports</category>
      <category>ruby</category>
      <category>rubygems</category>
      <category>irb</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>PGCon 2008 - Call for Papers</title>
      <description>&lt;p&gt;Are you using &lt;a href="http://postgresql.org"&gt;PostgreSQL&lt;/a&gt; (the world&amp;#8217;s most awesome open-source database server) with &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt;? Do you have any interesting experiences that you might want to share with an audience? Well, you might consider submitting a talk proposal for PGCon 2008, which is taking place in Ottawa, Canada.&lt;/p&gt;


	&lt;p&gt;Details follow&amp;#8230;&lt;/p&gt;


	&lt;h2&gt;PGCon 2008&lt;/h2&gt;


	&lt;p&gt;PGCon 2008 will be held 22-23 May 2008, in Ottawa at the University of
Ottawa.  It will be preceded by two days of tutorials on 20-21 May
2008.&lt;/p&gt;


	&lt;p&gt;We are now requesting proposals for presentations.&lt;/p&gt;


	&lt;p&gt;If you are doing something interesting with PostgreSQL, please submit
a proposal.  You might be one of the backend hackers or work on a
PostgreSQL related project and want to share your know-how with
others. You might be developing an interesting system using
PostgreSQL as the foundation. Perhaps you migrated from another
database to PostgreSQL and would like to share details.  These, and
other stories are welcome. Both users and developers are encouraged
to share their experiences.&lt;/p&gt;


	&lt;p&gt;Here are a few ideas to jump start your proposal process:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;novel, unique or complex ways in which PostgreSQL are used&lt;/li&gt;
		&lt;li&gt;migration of production systems to PostgreSQL&lt;/li&gt;
		&lt;li&gt;data warehousing with PostgreSQL&lt;/li&gt;
		&lt;li&gt;tuning PostgreSQL for different work loads&lt;/li&gt;
		&lt;li&gt;replicating data on top of PostgreSQL&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Both users and developers are encouraged to share their experiences.&lt;/p&gt;


	&lt;p&gt;The schedule is:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;19 Dec 2007 Proposal acceptance begins&lt;/li&gt;
		&lt;li&gt;19 Jan 2008 Proposal acceptance ends&lt;/li&gt;
		&lt;li&gt;19 Feb 2008 Confirmation of accepted proposals&lt;/li&gt;
		&lt;li&gt;19 Apr 2008 Final papers/slides must arrive no later than this date&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;See also &lt;a href="http://www.pgcon.org/2008/papers.php"&gt;http://www.pgcon.org/2008/papers.php&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Instructions for submitting a proposal to PGCon 2008 are available
from: &lt;a href="http://www.pgcon.org/2008/submissions.php"&gt;http://www.pgcon.org/2008/submissions.php&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;This&lt;/p&gt;
</description>
      <pubDate>Fri, 28 Dec 2007 10:58:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:77bc4f6f-b27a-4e11-8298-31a70f57809c</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/12/28/pgcon-2008-call-for-papers</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>PostgreSQL</category>
      <category>postgresql</category>
      <category>ruby</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>conference</category>
    </item>
    <item>
      <title>Using MacPorts Ruby and Rails after Upgrading to OS X Leopard</title>
      <description>&lt;p&gt;If you previously followed my article, &lt;a href="http://www.robbyonrails.com/articles/2007/06/19/installing-ruby-on-rails-and-postgresql-on-os-x-second-edition"&gt;Installing Ruby on Rails and PostgreSQL on &lt;span class="caps"&gt;OS X&lt;/span&gt;, second edition&lt;/a&gt; and are now upgrading to &lt;span class="caps"&gt;OS X&lt;/span&gt; Leopard, you&amp;#8217;ll want to make a few adjustments to your setup.&lt;/p&gt;


	&lt;p&gt;First of all, it&amp;#8217;s great that Apple has decided to provide Ruby on Rails out of the box.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
~ &amp;gt; gem list rails                                                                                                                                                                   
  *** LOCAL GEMS ***

  rails (1.2.3)
      Web-application framework with template engine, control-flow layer,
      and ORM.
&lt;/code&gt;&lt;/pre&gt;

How many gems does it come with?
&lt;pre&gt;&lt;code&gt;
~ &amp;gt; gem list|grep '^[a-z]'|wc -l                                                                                                                                                     
      29
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;It&amp;#8217;s really great that &lt;a href="http://apple.com"&gt;Apple&lt;/a&gt; shipped Leopard pre-installed with 29 gems, especially if you don&amp;#8217;t have your entire Rails stack setup already. In my case and for those that have followed my installation process, you don&amp;#8217;t need to switch over to this new development stack (yet). I have a lot of time invested in my fully-functionaly MacPorts installation process (PostgreSQL, MySQL, RMagick, Subversion, Git, etc. Since this all working fine on my machine, I&amp;#8217;m not ready to make the switch to Apple&amp;#8217;s installation.&lt;/p&gt;


	&lt;h2&gt;Don&amp;#8217;t Fix it&amp;#8230; if it&amp;#8217;s not broken!&lt;/h2&gt;


	&lt;p&gt;So, the the first thing that I did was modify my &lt;code&gt;PATH&lt;/code&gt; environment variable, which has &lt;code&gt;/usr/bin&lt;/code&gt; as the first path that it&amp;#8217;ll look at when you try to run commands like &lt;code&gt;ruby&lt;/code&gt;, &lt;code&gt;mongrel_rails&lt;/code&gt;, &lt;code&gt;gem&lt;/code&gt;, etc. You&amp;#8217;ll want to modify this and prepend &lt;code&gt;/opt/local/bin:&lt;/code&gt; to the front of &lt;code&gt;PATH&lt;/code&gt; in your shell configuration. If you&amp;#8217;re using bash, this would be&amp;#8230; &lt;code&gt;~/.bashrc&lt;/code&gt;. If you&amp;#8217;re using zshell like me, &lt;code&gt;~/.zshrc&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Now, when you start a new Terminal and run &lt;code&gt;gem list&lt;/code&gt;, you&amp;#8217;ll see all of the gems that you already have installed.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
~ &amp;gt; gem list rails                                                                                                                                   &amp;lt; new-host

*** LOCAL GEMS ***

rails (1.2.5, 1.2.4, 1.2.3, 1.1.6)
    Web-application framework with template engine, control-flow layer,
    and ORM.
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Back to my happy gems&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
~ &amp;gt; gem list|grep '^[a-z]'|wc -l                                                                                                                                                              &amp;lt; new-host
      72
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great! Now I can get back to work and spend time playing with the new features in Finder, Mail.app, and iChat instead of installing all of the software dependencies that our development projects have. :-)&lt;/p&gt;
</description>
      <pubDate>Sat, 27 Oct 2007 05:43:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4c96e766-87e4-41f4-9d7d-54fe826ed4e9</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/10/27/using-macports-ruby-and-rails-after-upgrading-to-os-x-leopard</link>
      <category>RubyURL</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>rails</category>
      <category>ruby</category>
      <category>gems</category>
      <category>rubyonrails</category>
      <category>osx</category>
      <category>DRY</category>
      <category>macports</category>
      <category>leopard</category>
      <category>zsh</category>
      <category>bash</category>
      <category>rmagick</category>
    </item>
    <item>
      <title>Chad Fowler's Dirty Little Secret?</title>
      <description>&lt;p&gt;I saw this photo of the Microsoft team from 1978 on &lt;a href="http://flickr.com/photos/anselmhook/1498377919/"&gt;Anselm&amp;#8217;s flickr&lt;/a&gt; and thought, &amp;#8220;Hmm, that looks like Chad Fowler!&amp;#8221;&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/chad_fowler_in_78-20071006-130251.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Could this be &lt;a href="http://chadfowler.com/"&gt;Chad Fowler&amp;#8217;s&lt;/a&gt; dirty little secret?..&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/imgp5302.png__png_image__413x416_pixels_-20071006-125640.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Happy Saturday!&lt;/p&gt;
</description>
      <pubDate>Sat, 06 Oct 2007 15:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c6f3710c-4bbc-415c-8bb4-17107749a5e0</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/10/06/chads-dirty-little-secret</link>
      <category>Off-Topic</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>sarcasm</category>
      <category>humor</category>
      <category>chad</category>
      <category>chadfowler</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>microsoft</category>
    </item>
    <item>
      <title>Edge Rails Documentation: Revisited</title>
      <description>&lt;p&gt;This question, &lt;em&gt;&amp;#8220;where can I find documentation for Edge Rails?&amp;#8221;&lt;/em&gt; still comes up quite often on mailing lists, &lt;span class="caps"&gt;IRC&lt;/span&gt;, and other places. I just wanted to point out a few resources for you.&lt;/p&gt;


	&lt;p&gt;In March 2006, &lt;a href="http://www.robbyonrails.com/articles/2006/03/03/bleeding-edge-rails-documentation"&gt;our team announced&lt;/a&gt; that we&amp;#8217;d be updating a &lt;span class="caps"&gt;RDOC&lt;/span&gt; site a few times a day as the Rails project gets commits.&lt;/p&gt;


	&lt;p&gt;You can still access the &lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt; Edge Rails documentation here:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://edgedocs.planetargon.org"&gt;http://edgedocs.planetargon.org&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Caboose also has some Edge Rails documentation here:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://caboo.se/doc.html"&gt;http://caboo.se/doc.html&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;If you&amp;#8217;re aware of any other online resources for Edge Rails documentation, please let me know.&lt;/p&gt;
</description>
      <pubDate>Wed, 26 Sep 2007 08:34:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6438d608-93ab-43c9-9fcd-5837529bd67c</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/09/26/edge-rails-documentation-revisited</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>edge</category>
      <category>edgerails</category>
      <category>documentation</category>
    </item>
    <item>
      <title>Boxcar: Open for business</title>
      <description>&lt;p&gt;We&amp;#8217;ve been quietly rolling out our &lt;a href="http://railsboxcar.com"&gt;new Rails hosting solution&lt;/a&gt; over the past month, each week&amp;#8230; inviting more people to ask questions and place orders. Initially, we invited some of our business hosting customers, and then sent out invites to those who signed up on the &lt;a href="http://railsboxcar.com"&gt;Rails Boxcar&lt;/a&gt; announcement list. We&amp;#8217;ve been taking orders for the past few weeks and have had sites running on Boxcar for over a month now.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.railsboxcar.com/img/boxcar_logo_wide.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;You&amp;#8217;ll also notice that we&amp;#8217;ve begun to phase out all of our older shared hosting solutions for new customers and are focusing solely on our Business and Boxcar accounts (aside from custom managed/dedicated solutions that we&amp;#8217;ve been offering upon request).&lt;/p&gt;


	&lt;p&gt;To learn more about Rails Boxcar, read &lt;a href="http://blog.planetargon.com/2007/8/22/rails-boxcar-is-here"&gt;the announcement on the &lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt; blog&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;In other news, &lt;a href="http://teknot.us"&gt;Daniel Johnson&lt;/a&gt;, our Lead Systems Administrator broke his arm while riding his bike while participating in &lt;a href="http://www.zoobomb.org"&gt;Zoo Bomb&lt;/a&gt; (and cracked his helmet in the process). He&amp;#8217;s at home today on pain medicine and we hope that he has a swift recovery.&lt;/p&gt;
</description>
      <pubDate>Tue, 04 Sep 2007 13:04:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:fdf9092d-96b5-4001-a034-ba5c1c354d9d</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/09/04/boxcar-open-for-business</link>
      <category>Ruby on Rails</category>
      <category>PLANET ARGON</category>
      <category>hosting</category>
      <category>boxcar</category>
      <category>deployment</category>
      <category>vps</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>daniel</category>
    </item>
    <item>
      <title>RubyURL: new design and code base</title>
      <description>&lt;p&gt;Yesterday evening, I deployed the new version of &lt;a href="http://rubyurl.com"&gt;RubyURL&lt;/a&gt;. This was a collaborative effort between &lt;a href="http://chriszgriffin.com/"&gt;Chris Griffin&lt;/a&gt; and I, which we&amp;#8217;re happy to finally push live.&lt;/p&gt;


	&lt;p&gt;There are a few things that we&amp;#8217;re going to push out in near future, such as an &lt;span class="caps"&gt;API&lt;/span&gt; and a new RubyGem.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/robbyrussell/1051199668/" title="Photo Sharing"&gt;&lt;img src="http://farm2.static.flickr.com/1331/1051199668_84a2781b5e.jpg" width="500" height="458" alt="RubyURL » Keep it short (and sweet)" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Chris volunteered to work on the new design and I did most of the programming in Ruby on Rails. When we worked on this, we really wanted to keep the process as simple as possible, despite &lt;a href="http://www.robbyonrails.com/articles/2007/07/16/rubyurl-2-0-on-the-horizon"&gt;some of the problems&lt;/a&gt; that the site has been having.&lt;/p&gt;


	&lt;p&gt;In the end, we have a Rails application that is only 85 lines of code and has a 1:2.3 code-to-spec ratio. I wanted to keep it under 100 lines of code. This means that there is some breathing room for further development.&lt;/p&gt;


	&lt;p&gt;We also tried out a beta account that I was given for &lt;a href="http://roundhaus.com/"&gt;RoundHaus&lt;/a&gt; for Subversion hosting. We had a really good experience using their service and were impressed by the plethora of useful features that came with the repository, such as continuous integration, rcov/code coverage stats, and twitter integration!.&lt;/p&gt;


	&lt;p&gt;If you find a bug, be sure to submit a ticket on the &lt;a href="http://planetargon.lighthouseapp.com/projects/4059-rubyurl/"&gt;RubyURL bug tracker&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;On a side note, we deployed this on a brand new &lt;a href="http://railsboxcar.com"&gt;Rails Boxcar&lt;/a&gt;, our new hosting solution that will be launched in the very near future. ;-)&lt;/p&gt;
</description>
      <pubDate>Wed, 08 Aug 2007 08:58:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9306d9e7-32b5-4afc-ba15-46cc3bc8590a</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/08/08/rubyurl-new-design-and-code-base</link>
      <category>RubyURL</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>rubyurl</category>
      <category>design</category>
      <category>development</category>
      <category>launch</category>
      <category>boxcar</category>
      <category>rubyonrails</category>
      <category>rails</category>
    </item>
    <item>
      <title>Spec Your Views</title>
      <description>&lt;p&gt;I meant to work on this post&amp;#8230; oh about 7 months ago.&lt;/p&gt;


	&lt;p&gt;Way back in January (7 months ago), Jamis Buck posted an article titled, &lt;a href="http://weblog.jamisbuck.org/2007/1/29/testing-your-views"&gt;Testing your views&lt;/a&gt;, which gave a few tips on using Test::Unit to, as the title suggests, test your views.&lt;/p&gt;


	&lt;p&gt;While, I&amp;#8217;m not going to rewrite everything that Jamis wrote, I&amp;#8217;d like to show you how to test these views with RSpec. (you might take a moment to quickly read his post&amp;#8230;)&lt;/p&gt;


	&lt;p&gt;In this example, I&amp;#8217;m going to show you how we&amp;#8217;re able to write specs for the following &lt;span class="caps"&gt;RHTML&lt;/span&gt;, which  you&amp;#8217;ll notice matches the code that he wrote tests for.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;% if @user.administrator? %&amp;gt;
    Hi &amp;lt;%= @user.name %&amp;gt;! You appear to be an administrator.
    &amp;lt;%= link_to "Click here", admin_url, :id =&amp;gt; "admin_link" %&amp;gt;
    to see the admin stuff!
  &amp;lt;% end %&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Jamis writes, &lt;em&gt;&amp;#8220;The only really significant thing you ought to be testing here is that the admin link only shows up for administrators. &amp;#8220;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;So, let&amp;#8217;s do just that, but with RSpec.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m not sure how Jamis is handling his view tests, but we&amp;#8217;re going to approach our view specs, much like we approach our controller specs, with the use of mocks and stubs, because we really don&amp;#8217;t need to spec any of our models at this level in the application.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Write specifications for your models&amp;#8230; in your model specs &lt;strong&gt;not&lt;/strong&gt; in your controller or view specs.&lt;/p&gt;


	&lt;p&gt;The first thing that we&amp;#8217;re going to do is setup a custom spec helper, because for something like an mocked user, will probably get reused in other areas of the user interface. Spec helpers are essentially modules that you can include in your RSpec descriptions (the block that starts with &lt;code&gt;describe&lt;/code&gt;) and reuse.&lt;/p&gt;


	&lt;p&gt;In this spec helper, I&amp;#8217;m going to include two methods, to mock the User model and stub out any of the methods that are necessary for spec&amp;#8217;n this view.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
module MockUserHelper
  def mock_normal_user
    user = mock(User)
    user.stub!(:administrator?).and_return(false)   # &amp;lt;--- NOT an admin
    user.stub!(:name).and_return('David Chelimsky')
    return user
  end

  def mock_admin_user
    user = mock(User)
    user.stub!(:administrator?).and_return(true)    # &amp;lt;--- IS an admin
    user.stub!(:name).and_return('Aslak Hellesoy')
    return user
  end
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;In the &lt;code&gt;mock_normal_user&lt;/code&gt; method, we&amp;#8217;re constructing a mock object and stubbing out the methods that we see are being called in the &lt;span class="caps"&gt;RHTML&lt;/span&gt; code. In &lt;code&gt;mock_admin_user&lt;/code&gt;, we&amp;#8217;re basically doing the same thing, but just stubbing the &lt;code&gt;administrator?&lt;/code&gt; method to return &lt;code&gt;true&lt;/code&gt; for this mock user.&lt;/p&gt;


	&lt;p&gt;By stubbing these methods, we&amp;#8217;ll be able to send a non-ActiveRecord object to the view and have it render without knowing the difference. For example, the &lt;code&gt;if @user.administrator?&lt;/code&gt; condition will return true or false, depending on how we stubbed it.&lt;/p&gt;


	&lt;p&gt;For more information on mocks and stubs, &lt;a href="http://rspec.rubyforge.org/documentation/mocks/index.html"&gt;read here&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Now that we have our spec helper, let&amp;#8217;s go ahead and dive into a few specifications for the view.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
describe "index page" do
  include MockUserHelper

  it "should render an admin link for an admin user" do
    assigns[:user] = mock_admin_user
    render 'index'
    response.should have_tag('a#admin_link')
  end

  it "should not render an admin link for a normal, non-admin user" do
    assigns[:user] = mock_normal_user
    render 'index'
    response.should_not have_tag('a#admin_link')
  end
end  
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;strong&gt;Please note:&lt;/strong&gt; This code example is only longer than the one shown by Jamis because he didn&amp;#8217;t include how he setup all his user sessions/objects. ;-)&lt;/p&gt;


	&lt;p&gt;When these specs are run, we can see the following results.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/rspec_results-20070801-233809.jpg" alt="" /&gt;&lt;br /&gt;&lt;small&gt;Pretty output courtesy of RSpec + TextMate bundle&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;Great, we&amp;#8217;ve been able to write specifications for our Rails views without a lot of pain. Stay tuned for more posts on this topic as I continue writing about how Designers and Developers can work together, in harmony. (&lt;a href="http://www.robbyonrails.com/articles/2007/08/01/designers-developers-and-the-x_-factor"&gt;see my last post on this topic&lt;/a&gt;)&lt;/p&gt;


	&lt;p&gt;For more information on adopting RSpec, please visit the &lt;a href="http://rspec.rubyforge.org"&gt;RSpec project homepage&lt;/a&gt;.&lt;/p&gt;
</description>
      <pubDate>Thu, 02 Aug 2007 02:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c21e25cf-1a4a-4b9f-a628-89fc00945829</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/08/02/spec-your-views</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>testing</category>
      <category>driven</category>
      <category>bdd</category>
      <category>rspec</category>
      <category>behavior</category>
      <category>mocks</category>
      <category>designers</category>
      <category>rhtml</category>
      <category>html</category>
      <category>specs</category>
    </item>
    <item>
      <title>Designers, Developers, and the x_ Factor</title>
      <description>&lt;p&gt;Our team is lucky enough to be in a position where we have both designers &lt;span class="caps"&gt;AND&lt;/span&gt; developers working on the same code base in parallel.&lt;/p&gt;


	&lt;p&gt;Since Ruby on Rails adopts the Model-View-Control pattern for separating business logic from the presentation layer, we&amp;#8217;re able to give our designers a lot of breathing room to to design the interface, whether it&amp;#8217;s for interaction or aesthetic reasons. However, sometimes this breathing room has resulted in small bugs slipping into the application interface. In general, nothing disastrous, but each bug that slips into the queue, slows down the project and we want to avoid as much of that as possible.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;d like to share a few issues that we&amp;#8217;ve seen occur on various occasions, and then show you what we&amp;#8217;ve done to avoid them happening again.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Scenario #1:&lt;/strong&gt; The case of the changed &lt;code&gt;div&lt;/code&gt; id, (victim: designer)&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Designer adds a few &lt;span class="caps"&gt;HTML&lt;/span&gt; elements to the page, defines an &lt;code&gt;id&lt;/code&gt; on a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tag and styles it with &lt;span class="caps"&gt;CSS&lt;/span&gt;.&lt;/li&gt;
		&lt;li&gt;A few days later, a developer needs to make some changes, tests it in their favorite browser and commits.&lt;/li&gt;
		&lt;li&gt;Later, the designer doesn&amp;#8217;t understand why the styling is all messed up. &amp;#8220;It &lt;em&gt;was&lt;/em&gt; working fine.&amp;#8221; &lt;/li&gt;
		&lt;li&gt;...minutes, hours&amp;#8230; go by where the designer tries to track down the issue. &amp;#8220;Oh! Someone renamed the &lt;code&gt;id&lt;/code&gt; in this &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tag. Sigh.&amp;#8221; &lt;/li&gt;
		&lt;li&gt;Developer apologies, but explains that he needed to do it because he needed to make it work with his new &lt;span class="caps"&gt;RJS&lt;/span&gt; code.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;strong&gt;Scenario #2:&lt;/strong&gt; The case of the changed &lt;code&gt;div&lt;/code&gt; id, (victim: developer)&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Developer is implementing this cool new Ajax feature into the web application
	&lt;ul&gt;
	&lt;li&gt;The code relies on there being one or many &lt;span class="caps"&gt;HTML&lt;/span&gt; elements in the &lt;span class="caps"&gt;DOM&lt;/span&gt; with specific &lt;code&gt;id&lt;/code&gt; values defined.&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Example: &lt;code&gt;&amp;lt;div id="notification_message"&amp;gt;&lt;/code&gt;&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;A few days later, a designer is making some changes to the layout and needs to restyle some of the view that this &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tag is defined. Designer decides to change the id to a different value for any variety of reasons. (or perhaps they changed it to use a class instead of styling it by the id). Often times, we don&amp;#8217;t know who set the id or class&amp;#8230; and many times the developers aren&amp;#8217;t savvy enough with &lt;span class="caps"&gt;HTML&lt;/span&gt; and designers end up cleaning things up a bit. &lt;/li&gt;
		&lt;li&gt;Later, code is checked in and designer didn&amp;#8217;t notice that the Ajax was now breaking as they weren&amp;#8217;t focusing on just the layout.&lt;/li&gt;
		&lt;li&gt;Day or two later, developer sees bug, &amp;#8220;Feature X isn&amp;#8217;t working, throwing JavaScript error&amp;#8230;&amp;#8221; &lt;/li&gt;
		&lt;li&gt;Developer is confused, &amp;#8220;Hey, that was working! What happened?&amp;#8221; &lt;/li&gt;
		&lt;li&gt;Developer tracks down the problem, discusses with designer, they figure out a solution. Problem solved.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I could outline a few other examples, but I really wanted to highlight these two types of situations, as our team has seen this happen on several occasions. Luckily, we&amp;#8217;ve learned through these experiences and have taken some measures to try and avoid them in the future.&lt;/p&gt;


	&lt;h2&gt;Moving forward (together)&lt;/h2&gt;


	&lt;p&gt;Both of the examples above, were essentially the same problem, but resulted in problems for a different role in the design and development cycle. While, I&amp;#8217;ve definitely been the victim of #2 several times myself, I know that I&amp;#8217;ve also been the guilty of #1. So, what can we do as designers and developers to work with each other without causing these little problems from occurring? (remember: many little problems can add up to a lot of wasted time spent resolving them)&lt;/p&gt;


	&lt;p&gt;Several months ago, I had a meeting with &lt;a href="http://chriszgriffin.com/"&gt;Chris&lt;/a&gt; (User Interface Designer) and &lt;a href="http://blog.imperialdune.com/"&gt;Graeme&lt;/a&gt; (Lead Architect/Developer) to discuss this very problem. At the time, we were implementing a lot of Ajax into an application and were occasionally running into Scenario #2. We discussed a few possible ways of communicating that, &amp;#8220;yes, this div id should &lt;span class="caps"&gt;NOT&lt;/span&gt; be changed (without talking to a developer first)!&amp;#8221;&lt;/p&gt;


	&lt;h3&gt;Idea 1: Comment our &amp;#8220;special&amp;#8221; &lt;span class="caps"&gt;HTML&lt;/span&gt; elements&lt;/h3&gt;


	&lt;p&gt;We discussed using ERb comments in our views to do something like the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;% # no seriously, please don't change this id, it's needed for some Ajax stuff %&amp;gt;
  &amp;lt;div id="notification_message"&amp;gt;
    ...
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;We all agreed that, while effective, it was going to clutter up our &lt;span class="caps"&gt;RHTML&lt;/span&gt; code more than any of us desired.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Team Response:&lt;/strong&gt; &lt;em&gt;Meh.&lt;/em&gt;&lt;/p&gt;


	&lt;h3&gt;Idea 2: Reserve id&amp;#8217;s for developers&lt;/h3&gt;


	&lt;p&gt;Another idea that came up, was to ask that designers only use classes and ids wold be used by the developers when they needed it.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;div id="developer_terriroty" class="designer_territory"&amp;gt;
    ...
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Chris pointed out that this wasn&amp;#8217;t an ideal solution as there is a distinct case for when to use ids versus classes.. and he is very strict about adhering to the &lt;span class="caps"&gt;HTML&lt;/span&gt;/CSS standards.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Team Response&lt;/strong&gt;: &lt;em&gt;Not hot about it&amp;#8230;&lt;/em&gt;&lt;/p&gt;


	&lt;h3&gt;Idea 3: Naming convention for Ajax-dependent elements&lt;/h3&gt;


	&lt;p&gt;The third idea that was discussed, was specifying a naming convention for any elements that were needed by our Ajax code. We played around on the whiteboard with some ideas and settled on the idea that we&amp;#8217;d prefix our id&amp;#8217;s with something easy to remember for both designers and developers.&lt;/p&gt;


	&lt;p&gt;We agreed on&amp;#8230; &lt;code&gt;x_&lt;/code&gt; (x underscore), which would make an element id look something like this:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;div id="x_notification_message"&amp;gt;
    ...
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;strong&gt;x == ajax&lt;/strong&gt;... get it?&lt;/p&gt;


	&lt;p&gt;While this adds the strain of typing two more characters to much of our &lt;span class="caps"&gt;RJS&lt;/span&gt; code, we don&amp;#8217;t run into Scenario #2 very often anymore.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  render :update do |page|
    page[:x_notification_message] = 'Something exciting happened... and this is your notification!'
    page[:x_notification_message].visual_effect :highlight
  end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;or in client-side JavaScript (where we also use this)...&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $('x_notification_message').do_something
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;I find that this helps our team keep a clear distinction between what can and shouldn&amp;#8217;t be changed in the views by our designers. Sometimes they have a good reason to do so, but they know that if there is &lt;code&gt;x_&lt;/code&gt;, then they should ask one of the developers on the team for assistance in renaming it without causing any problems in the application. It also allows our designers to add classes to these elements, or style the id that we&amp;#8217;ve defined.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Team Response&lt;/strong&gt;: &lt;em&gt;Wow, was that all we needed to agree on? Hooray!&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;This leads me to some other problems that have/may come up, but I&amp;#8217;ll discuss that in my next post on this topic, when I&amp;#8217;ll show you how we can use RSpec to avoid these sorts of designer versus developer problems.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re working in a similar environment, how are your designers and developers working, together, in perfect harmony?&lt;/p&gt;


	&lt;p&gt;Until next time, remember to &lt;a href="http://www.robbyonrails.com/articles/2007/05/23/hug-your-designer-day-part-2"&gt;hug your designer&lt;/a&gt;. ...and if you&amp;#8217;re still having developer &lt;em&gt;design&lt;/em&gt; your applications, consider hiring a designer. ;-)&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;:&lt;/strong&gt; changed examples after a few comments about using div_for as another solution. (see comments for details)&lt;/p&gt;
</description>
      <pubDate>Wed, 01 Aug 2007 00:39:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:bcf3fb50-6b05-48cd-830f-43144d80c243</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/08/01/designers-developers-and-the-x_-factor</link>
      <category>Ruby on Rails</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>rails</category>
      <category>ajax</category>
      <category>development</category>
      <category>rubyonrails</category>
      <category>agile</category>
      <category>design</category>
      <category>process</category>
      <category>views</category>
      <category>designers</category>
      <category>developers</category>
      <category>rhtml</category>
      <category>erb</category>
      <category>conventions</category>
      <category>bugs</category>
    </item>
    <item>
      <title>YSlow and Rails performance: Getting UJS and AssetPackager to play nice  </title>
      <description>&lt;p&gt;Yesterday, I started to dig deeper into &lt;a href="http://developer.yahoo.com/yslow/"&gt;YSlow&lt;/a&gt; and decided to pick an application that we recently launched for a client. The performance grade that I saw at first was an F, which wasn&amp;#8217;t surprising to me because we knew that there was going to be some fine tuning in the near future.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/30elm___assets-20070727-100946.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;There is a lot of JavaScript in this application and we have several files to break up stuff to make it more maintainable. However, in production, we really don&amp;#8217;t need to send the client (browser) 19 different JS files. We&amp;#8217;ve been using mod_deflate to compress these files, but it doesn&amp;#8217;t solve the problem of having several connections opening to download all the necessary JavaScript. The same is true for our &lt;span class="caps"&gt;CSS&lt;/span&gt; files.&lt;/p&gt;


	&lt;p&gt;At RailsConf, &lt;span class="caps"&gt;DHH&lt;/span&gt; announced that an upcoming version of Rails would bundle all the stylesheet and javascript files into one file and compress it. We&amp;#8217;re running on 1.2.x for this application and decided to look at the &lt;a href="http://synthesis.sbecker.net/pages/asset_packager"&gt;AssetPackager plugin&lt;/a&gt; as a good solution to this problem.&lt;/p&gt;


	&lt;p&gt;I installed the plugin via &lt;a href="http://piston.rubyforge.org/"&gt;piston&lt;/a&gt; and ran the following task, which is provided by AssetPackager.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;rake asset:packager:create_yml&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This went ahead and created &lt;code&gt;config/assets_packager.yml&lt;/code&gt;. I then went ahead and updated our capistrano configuration to call the rake task after updating the code on the server when deploying.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
desc "all of our other tasks/commands to run after updating the code" 
task :after_update_code do
  #
  # all of our other tasks/commands
  #
  run "cd #{release_path} &amp;#38;&amp;#38; rake RAILS_ENV=production asset:packager:build_all" 
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The first thing that I noticed was that the yml file that gets generated will not make any assumption as to what order the javascript libraries should be loaded. So, immediately, line 1 of our compressed javascript file was causing an error as the code was trying to reference a library that hadn&amp;#8217;t been defined yet (showed up later in the file). So, when you do this, you&amp;#8217;ll need to organize the yml file to load things in order that they are needed. This was also a good opportunity for us to say, &amp;#8220;oh, we&amp;#8217;re not using that one anymore. Let&amp;#8217;s remove it.&amp;#8221;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
--- 
javascripts: 
- base: 
  - prototype  
  - effects
  - scriptaculous
  - controls
  - dragdrop
  - application
  - slider
  - pngfix
  - nav
  - lowpro
  - lightbox
  - folder
  - builder
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, so we re-dployed and everything at first glance seemed fine&amp;#8230; &lt;em&gt;or so we thought!&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;We used the &lt;a href="http://www.ujs4rails.com/"&gt;unobtrusive javascript plugin&lt;/a&gt; for this project and it seems that we couldn&amp;#8217;t just compress every single file. Each page has a behaviors javascript file and since everything was being compressed into one file (and cached), &lt;span class="caps"&gt;RJS&lt;/span&gt; calls quickly broke throughout the site. &lt;strong&gt;&lt;span class="caps"&gt;OH NO&lt;/span&gt;!&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;So, I opted to merge all of the other javascript files and use the standard way of including unobtrusive javascript in the application layout.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
&amp;lt;%= javascript_include_merged :base %&amp;gt;
&amp;lt;%= javascript_include_tag :unobtrusive %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;We also removed &lt;code&gt;lowpro&lt;/code&gt; from the list of javascript files to compress since the ujs plugin is currently including this when we call &lt;code&gt;&amp;lt;%= javascript_include_tag :unobtrusive %&amp;gt;&lt;/code&gt;. I plan to look into modifying this so we it&amp;#8217;ll only include the page-specific behaviors and not load the lowpro javascript file (so we can compress that as well).&lt;/p&gt;


	&lt;p&gt;Once this was re-deployed, we saw that the &lt;span class="caps"&gt;RJS&lt;/span&gt; issues were resolved and everything felt to be loading quicker. But, let&amp;#8217;s look at YSlow again for step 1 in improving the performance of the application.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;side note:&lt;/strong&gt; the following grading was also after making some other adjustments that were suggested by YSlow, which I&amp;#8217;ll discuss in another blog post soon.&lt;/p&gt;


	&lt;p&gt;So, where we once had a grade F, we now have an D&amp;#8230; which is due to the client having us add several (four) external javascript files for mint, google analytics, etc. We&amp;#8217;re only loading 3 javascript files for the application, when we were originally loading many more.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/30elm___your_address_for_home_design-20070727-114427.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Obviously, there is some more tuning to be done, but we went from a grading of 43 to 74 in about three hours of time spent reading the YSlow documentation, adding asset_packager, and making various tweaks to our web servers (as suggested by YSlow).&lt;/p&gt;


	&lt;p&gt;Until next time&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Related Posts:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.robbyonrails.com/articles/2007/01/16/every-second-counts-with-a-piston-in-your-trunk"&gt;Every Second Counts with a Piston in your Trunk&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
</description>
      <pubDate>Fri, 27 Jul 2007 13:40:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e47a0bfa-0fff-42da-90a6-0c95701cdcc3</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/07/27/yslow-and-rails-performance-getting-ujs-and-assetpackager-to-play-nice</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>assets</category>
      <category>javascript</category>
      <category>rails</category>
      <category>performance</category>
      <category>yslow</category>
      <category>rubyonrails</category>
      <category>deployment</category>
      <category>capistrano</category>
      <category>compression</category>
      <category>hosting</category>
    </item>
    <item>
      <title>Rails Code Audit Tips - Filtered Parameter Logging</title>
      <description>&lt;p&gt;It&amp;#8217;s been a month since I posted, &lt;a href="http://www.robbyonrails.com/articles/2007/06/17/audit-your-rails-development-team"&gt;Audit Your Rails Development Team&lt;/a&gt; and now I find myself sitting in a hotel room in Mankato, Minnesota with &lt;a href="http://blog.imperialdune.com/"&gt;Graeme&lt;/a&gt; after a long day of walking through the documents that we delivered to our client after conducting a &lt;a href="http://www.planetargon.com/contact.html"&gt;Rails Code Audit and Review&lt;/a&gt;. Our client felt that it would be a great idea to have us visit with six of their employees and walk through the various topics that we brought up in our process. We&amp;#8217;ve been doing several of these audits recently and are thought that it would be a good idea to begin sharing some problems that we&amp;#8217;ve discovered across projects.&lt;/p&gt;


	&lt;p&gt;As much as we like to find lots things that we&amp;#8217;d recommend improving in Rails applications, we also want to make sure that as many projects as possible avoid some of these common oversights. So, expect to see more posts related to things that we find through our Code Audit and Review process.&lt;/p&gt;


	&lt;p&gt;Today, I&amp;#8217;d like to point out a potential security problem that is often overlooked by developers and system administrators.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Log files&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;Does your application request any of the following information from your users?&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Social security number&lt;/li&gt;
		&lt;li&gt;Credit card date (number, expiration date, etc..)&lt;/li&gt;
		&lt;li&gt;Passwords&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;BY DEFAULT&lt;/span&gt;&lt;/strong&gt;, all of this data is being written to your production log file. Even if you&amp;#8217;re encrypting this data in your database, request parameters (get/post) are all written to your production logs without any encryption. Log files are also notorious for having insecure file permissions, so if you&amp;#8217;re on a shared host, other accounts on the server might be able to view them. Regardless of how secure you &lt;em&gt;think&lt;/em&gt; your server is, this isn&amp;#8217;t data that you want sitting around.&lt;/p&gt;


	&lt;p&gt;Lucky for you, Ruby on Rails has an easy solution to this problem! All that you need to do is use the &lt;code&gt;filter_parameter_logging&lt;/code&gt; method in your controller(s). We generally add something like the following to our application controller.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  filter_parameter_logging :social_security_number, :password, :credit_card_number, 'some-other-param' 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This will replace the value from the parameters with &lt;code&gt;[FILTERED]&lt;/code&gt;, which solves this problem rather nicely.&lt;/p&gt;


	&lt;p&gt;So, it would be our recommendation, that if your application is storing &lt;em&gt;any&lt;/em&gt; sensitive data, that you take advantage of this simple solution. Be sure to read more about &lt;a href="http://api.rubyonrails.org/classes/ActionController/Base.html#M000260"&gt;filter_parameter_logging&lt;/a&gt; before you implement this for various usage examples.&lt;/p&gt;


	&lt;p&gt;Stay tuned for more tips and tricks. If you&amp;#8217;re interested in contracting us for our Rails Code Audit and Review service, &lt;a href="http://planetargon.com/contact.html"&gt;give us a call&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Tomorrow, Graeme and I will be meeting for another day with our clients and then we fly home to Portland, Oregon in the evening. We survived our first tornado warnings, which was exciting as we don&amp;#8217;t get those on the west coast. ;-)&lt;/p&gt;
</description>
      <pubDate>Mon, 16 Jul 2007 22:50:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:be1a19cb-83b3-4ec7-a12b-6df18e6ce62d</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/07/16/rails-code-audit-tips-filtered-parameter-logging</link>
      <category>Business</category>
      <category>Ruby on Rails</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>code</category>
      <category>audit</category>
      <category>logging</category>
      <category>security</category>
      <category>privacy</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>filtering</category>
      <category>parameters</category>
      <category>params</category>
    </item>
    <item>
      <title>Installing Ruby on Rails and PostgreSQL on OS X, Second Edition</title>
      <description>&lt;p&gt;It&amp;#8217;s been just over a year since I posted the article, &lt;a href="http://www.robbyonrails.com/articles/2006/05/29/install-ruby-rails-and-postgresql-on-osx"&gt;Install Ruby, Rails, and PostgreSQL on &lt;span class="caps"&gt;OSX&lt;/span&gt;&lt;/a&gt; and it still gets quite a bit of traffic. Unfortunately, there have been a few changes in the install process that have caught people.&lt;/p&gt;


	&lt;p&gt;Today, I am leaving my PowerBook G4. It&amp;#8217;s being replaced with a MacBook because the logic board is on the fritz. So, guess what that means? I get to install Ruby, Ruby on Rails, PostgreSQL on &lt;span class="caps"&gt;OS X&lt;/span&gt; again! I figured that I would post a revised version of my previous article for those who may go through this same process in the near future.&lt;/p&gt;


&lt;div class="warning"&gt;
&lt;strong&gt;&lt;span class="caps"&gt;&lt;span class="caps"&gt;WARNING&lt;/span&gt;&lt;/span&gt;:&lt;/strong&gt; This post contains some outdated instructions. Please read &lt;a href="http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition"&gt; Installing Ruby on Rails and PostgreSQL on &lt;span class="caps"&gt;&lt;span class="caps"&gt;OS X&lt;/span&gt;&lt;/span&gt;, Third Edition&lt;/a&gt;, which is focused on Installing Ruby on Rails on Leopard.
&lt;/div&gt;
&lt;h2&gt;Step Zero: Install iTerm (optional)&lt;/h2&gt;


	&lt;p&gt;You&amp;#8217;ll spend a lot of time in your terminal as a Rails developer. I&amp;#8217;m not a big fan of Terminal.app as it lacks tabbed windows&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt; and you&amp;#8217;ll often find me with around ten tabs open. I&amp;#8217;ve been using &lt;a href="http://iterm.sourceforge.net/"&gt;iTerm&lt;/a&gt; for a few years and it&amp;#8217;s definitely improved in the past year and doesn&amp;#8217;t seem to crash nearly as often as it used to.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://iterm.sourceforge.net/download.shtml"&gt;Download the latest iTerm release&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Once installed, I always change the default color scheme as I prefer the white on black schema. The menus in iTerm are lacking some thoughtful interaction design, but I&amp;#8217;ve figured out the right way to do it (after a long time of stumbling on it by accident). In iTerm, you&amp;#8217;ll want to &lt;strong&gt;edit&lt;/strong&gt; the Default bookmark, which you can access by going to Manage Bookmarks under the Bookmarks Menu.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.robbyonrails.com/files/ror_osx_iterm_bookmark.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Set the &lt;strong&gt;Display&lt;/strong&gt; value to &lt;strong&gt;classic iTerm&lt;/strong&gt; and you&amp;#8217;re golden.&lt;/p&gt;


	&lt;p&gt;Now&amp;#8230; let&amp;#8217;s get to business&amp;#8230;&lt;/p&gt;


	&lt;h2&gt;Step 1: Install Xcode Tools&lt;/h2&gt;


	&lt;p&gt;Without installing Xcode tools from Apple, we&amp;#8217;re not going to get very far. First, you&amp;#8217;ll need to grab a copy of Xcode, which you can download on Apple&amp;#8217;s Developer Connection site. It&amp;#8217;s almost a 1GB download, so you&amp;#8217;ll want to start your download and use your multi-tasking skills and &lt;a href="http://drinkviso.com/"&gt;grab a Viso&lt;/a&gt;, read some &lt;a href="http://www.planetrubyonrails.org"&gt;blog&lt;/a&gt; &lt;a href="http://therailsway.com/"&gt;posts&lt;/a&gt;.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://developer.apple.com/tools/download/"&gt;Download Xcode&lt;/a&gt; (dmg)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I&amp;#8217;m going to make the assumption here that you know how to install a dmg on osx. Once this is installed, you can move on to the next step!&lt;/p&gt;


	&lt;h2&gt;Step 2: All Your MacPorts are Belong to Us&lt;/h2&gt;


	&lt;p&gt;&lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; (formerly known as DarwinPorts) is a package management system for &lt;span class="caps"&gt;OS X&lt;/span&gt;. This is what we&amp;#8217;ll use to install most of the necessary programs to develop and run your Ruby on Rails applications. If you&amp;#8217;re from the Linux or &lt;span class="caps"&gt;BSD&lt;/span&gt; world, you are likely familiar with similar tools&amp;#8230; such as: &lt;code&gt;apt-get&lt;/code&gt;, &lt;code&gt;port&lt;/code&gt;, and &lt;code&gt;yum&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;You&amp;#8217;ll want to download MacPorts and install the dmg file.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.robbyonrails.com/files/ror_osx_macports.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Now that this is installed, we should test it.&lt;/p&gt;


	&lt;p&gt;With a new terminal, run the following:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ port version
Version: 1.442
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Success! Let&amp;#8217;s get going&amp;#8230;&lt;/p&gt;


	&lt;h2&gt;Step 3: Installing the Ruby on Rails development stack&lt;/h2&gt;


	&lt;p&gt;We&amp;#8217;re going to go through a series of small steps, which may take some time depending on how fast your internet connection and computer is.&lt;/p&gt;


	&lt;h3&gt;Install Ruby and RubyGems&lt;/h3&gt;


	&lt;p&gt;In order to install Ruby, we&amp;#8217;re going to use MacPorts with the &lt;code&gt;port&lt;/code&gt; command, which is now available for installing various packages on our &lt;span class="caps"&gt;OS X&lt;/span&gt; machines.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo port install ruby rb-rubygems&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;It&amp;#8217;ll probably take a while to download and install Ruby and all of it&amp;#8217;s known dependencies. In the meantime, check out &lt;a href="http://lolcode.com/"&gt;some funny code&lt;/a&gt;. &lt;span class="caps"&gt;KTHXBYE&lt;/span&gt;!&lt;/p&gt;


	&lt;p&gt;Still waiting for it to install, perhaps you could do something like&amp;#8230; begin writing a comment on this post, writing your own blog post, &lt;a href="http://www.youtube.com/watch?v=sLD0SNCFtyA"&gt;watch a funny video&lt;/a&gt;, or &lt;a href="http://workingwithrails.com/recommendation/new/person/5408-robby-russell"&gt;recommend me&lt;/a&gt;. I walked to &lt;a href="http://www.backspace.bz/"&gt;Backspace&lt;/a&gt; with Gary to get an Americano&amp;#8230; and it&amp;#8217;s still not done. :-p&lt;/p&gt;


	&lt;p&gt;(minutes/hours/weeks later)&lt;/p&gt;


	&lt;p&gt;Okay&amp;#8230; I trust that it finished installing Ruby and RubyGems without any hiccups. Let&amp;#8217;s test them from our terminal to make sure.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s check the version&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now, let&amp;#8217;s make sure that Ruby is working properly&amp;#8230;&lt;/p&gt;


&lt;code&gt;&lt;pre&gt;
$ irb
irb(main):001:0&amp;gt; x = 1     
=&amp;gt; 1
irb(main):002:0&amp;gt; puts "wee!!!" if x == 1
wee!!!
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, we&amp;#8217;re on a roll. Let&amp;#8217;s get the rest of the stack installed.&lt;/p&gt;


	&lt;h3&gt;Install Ruby on Rails&lt;/h3&gt;


	&lt;p&gt;We&amp;#8217;re going to install Ruby on Rails with the &lt;code&gt;gem&lt;/code&gt; command that installing RubyGems provided.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo gem install -y rails
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This command should produce an output similar to the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
Successfully installed rails-1.2.3
Successfully installed rake-0.7.3
Successfully installed activesupport-1.4.2
Successfully installed activerecord-1.15.3
Successfully installed actionpack-1.13.3
Successfully installed actionmailer-1.3.3
Successfully installed actionwebservice-1.2.3
Installing ri documentation for rake-0.7.3...
Installing ri documentation for activesupport-1.4.2...
Installing ri documentation for activerecord-1.15.3...
Installing ri documentation for actionpack-1.13.3...
Installing ri documentation for actionmailer-1.3.3...
Installing ri documentation for actionwebservice-1.2.3...
Installing RDoc documentation for rake-0.7.3...
Installing RDoc documentation for activesupport-1.4.2...
Installing RDoc documentation for activerecord-1.15.3...
Installing RDoc documentation for actionpack-1.13.3...
Installing RDoc documentation for actionmailer-1.3.3...
Installing RDoc documentation for actionwebservice-1.2.3...    
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Install Rails-friendly gems&lt;/h3&gt;


	&lt;p&gt;&lt;strong&gt;Mongrel&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re developing with Rails, it&amp;#8217;s highly recommended that you use install and use &lt;a href="http://mongrel.rubyforge.org"&gt;Mongrel&lt;/a&gt; for your development and production environments. The following command will install the mongrel and mongrel_cluster gems (including their dependencies).&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo gem install -y mongrel mongrel_cluster&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;small&gt;* Note: Be sure to select the proper platform for mongrel. (hint: &lt;span class="caps"&gt;OS X&lt;/span&gt; is &lt;span class="caps"&gt;NOT&lt;/span&gt; mswin32)&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;My terminal output:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo gem install -y mongrel mongrel_cluster
Password:
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i686-darwin8.9.1)
 1. mongrel 1.0.1 (mswin32)
 2. mongrel 1.0.1 (ruby)
 3. mongrel 1.0 (mswin32)
 4. mongrel 1.0 (ruby)
 5. Skip this gem
 6. Cancel installation
&amp;gt; 2
Select which gem to install for your platform (i686-darwin8.9.1)
 1. fastthread 1.0 (ruby)
 2. fastthread 1.0 (mswin32)
 3. fastthread 0.6.4.1 (mswin32)
 4. fastthread 0.6.4.1 (ruby)
 5. Skip this gem
 6. Cancel installation
&amp;gt; 1
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed mongrel-1.0.1
Successfully installed daemons-1.0.6
Successfully installed fastthread-1.0
Successfully installed gem_plugin-0.2.2
Successfully installed cgi_multipart_eof_fix-2.1
Installing ri documentation for mongrel-1.0.1...
Installing ri documentation for daemons-1.0.6...
Installing ri documentation for gem_plugin-0.2.2...
Installing ri documentation for cgi_multipart_eof_fix-2.1...
Installing RDoc documentation for mongrel-1.0.1...
Installing RDoc documentation for daemons-1.0.6...
Installing RDoc documentation for gem_plugin-0.2.2...
Installing RDoc documentation for cgi_multipart_eof_fix-2.1...
Successfully installed mongrel_cluster-0.2.1    
&lt;/code&gt;&lt;/pre&gt;

	&lt;h2&gt;Step 4: Installing the World&amp;#8217;s Most Advanced Database Server&amp;#8230; PostgreSQL!&lt;/h2&gt;


	&lt;p&gt;At &lt;a href="http://planetargon.com"&gt;&lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt;&lt;/a&gt;, we develop our applications on top of &lt;a href="http://postgresql.or"&gt;PostgreSQL&lt;/a&gt;. I&amp;#8217;ve long been advocating the adoption of this &lt;em&gt;awesome&lt;/em&gt; open source database in the Rails community. Just over a year ago, &lt;a href="http://jvoorhis.com"&gt;Jeremy Voorhis&lt;/a&gt; (PLANET &lt;span class="caps"&gt;ARGON&lt;/span&gt; alumnus) and I were &lt;a href="http://odeo.com/audio/1069086/view"&gt;interviewed on the Ruby on Rails podcast&lt;/a&gt; and had the opportunity to discuss our preference of PostgreSQL over the alternatives (mysql, sqlite, firebird, etc.).&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;re going to install &lt;a href="http://www.postgresql.org/docs/8.2/static/release-8-2.html"&gt;PostgreSQL 8.2&lt;/a&gt; from MacPorts by running the following command.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo port install postgresql82 postgresql82-server&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;While this is installing, you might take a moment to check out &lt;a href="http://whytheluckystiff.net/comics/differentSpaceShuttles.html"&gt;some space shuttles&lt;/a&gt;.&lt;/p&gt;


	&lt;h3&gt;Setting up PostgreSQL&lt;/h3&gt;


	&lt;p&gt;You may have noticed the output of the previous port installation of PostgreSQL 8.2, suggested that you do the following. Let&amp;#8217;s do that now&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo mkdir -p /opt/local/var/db/postgresql82/defaultdb
$ sudo chown postgres:postgres /opt/local/var/db/postgresql82/defaultdb
$ sudo su postgres -c '/opt/local/lib/postgresql82/bin/initdb -D /opt/local/var/db/postgresql82/defaultdb'    
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Have PostgreSQL start automatically on system start-ups&lt;/h4&gt;


	&lt;p&gt;Unless you&amp;#8217;re concerned about extra applications running in the background, I&amp;#8217;d encourage you to add PostgreSQL to launchd, which will start it automatically after system reboots.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql82-server.plist&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Adding PostgreSQL commands to your $PATH&lt;/h4&gt;


	&lt;p&gt;For some reason, MacPorts doesn&amp;#8217;t add the PostgreSQL programs to the default bash &lt;span class="caps"&gt;PATH&lt;/span&gt;, which means that you can&amp;#8217;t run &lt;code&gt;psql&lt;/code&gt;, &lt;code&gt;pg_dump&lt;/code&gt;, or &lt;code&gt;createdb&lt;/code&gt;/&lt;code&gt;dropdb&lt;/code&gt; without specifying the full path to where they were installed. What we&amp;#8217;ll do is add them to our default terminal profile.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;sudo vi /etc/profile&lt;/code&gt;&lt;/pre&gt; (you can use &lt;code&gt;mate&lt;/code&gt;, &lt;code&gt;emacs&lt;/code&gt;, &lt;code&gt;joe&lt;/code&gt; or any other preferred editor to do this)

	&lt;p&gt;This file gets loaded every time a new terminal session is started.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s add &lt;code&gt;/opt/local/lib/postgresql82/bin&lt;/code&gt; to the end of the value for &lt;span class="caps"&gt;PATH&lt;/span&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/opt/local/lib/postgresql82/bin"    
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Save the file and then open a new terminal. To test this, you should get the following output when you run &lt;code&gt;which psql&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ which psql
/opt/local/lib/postgresql82/bin/psql
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Creating a new PostgreSQL user&lt;/h4&gt;


	&lt;p&gt;When I&amp;#8217;m working on Rails applications in my development environment, I really don&amp;#8217;t want to have to specify a username and password in every &lt;code&gt;config/database.yml&lt;/code&gt; file for each of our ongoing client projects. When PostgreSQL was installed, it created a superuser named &lt;code&gt;postgres&lt;/code&gt;, which is great, but I&amp;#8217;d like one that matches my system username, so that I&amp;#8217;m not prompted at all for a username or password to connect to PostgreSQL.&lt;/p&gt;


	&lt;p&gt;To do this, we&amp;#8217;ll use the &lt;code&gt;createuser&lt;/code&gt; command, which comes with PostgreSQL. As you can see, I&amp;#8217;m creating a new user with superuser privileges (and will hopefully be the last time I have to do a -U postgres).&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ createuser --superuser robbyrussell -U postgres
CREATE ROLE
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Let&amp;#8217;s take a quick moment to test this out.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
# create a new database
$ createdb my_test_db
CREATE DATABASE

# drop the database
$ dropdb my_test_db
DROP DATABASE
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, everything looks good here.&lt;/p&gt;


	&lt;p&gt;We now have a running installation of PostgreSQL with a new user account. All we need to do now is install the appropriate RubyGem to allow our Ruby applications to connect to it.&lt;/p&gt;


	&lt;h3&gt;Installing the Ruby Postgres gem&lt;/h3&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;&lt;/strong&gt;: Hydro posted a commented, which lead me to the ruby-postgres gem.&lt;/p&gt;


	&lt;p&gt;You can install ruby-postgres gem by running the following command.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo gem install -y ruby-postgres
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Let&amp;#8217;s take a moment to test that this installed properly.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ irb
irb(main):001:0&amp;gt; require 'rubygems'
=&amp;gt; true
irb(main):002:0&amp;gt; require 'postgres'
=&amp;gt; true
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;If this returns true, than we should be good to go. We&amp;#8217;ve now built a professional development environment for working with Ruby on Rails. &lt;strong&gt;Doesn&amp;#8217;t that feel great?&lt;/strong&gt;&lt;/p&gt;


	&lt;h2&gt;Test your install&lt;/h2&gt;


	&lt;p&gt;You can look back at &lt;a href="http://www.robbyonrails.com/articles/2006/05/29/install-ruby-rails-and-postgresql-on-osx"&gt;my older post&lt;/a&gt; to walk through the process of testing out your setup with a new Rails application.&lt;/p&gt;


	&lt;h2&gt;Closing thoughts&lt;/h2&gt;


	&lt;p&gt;I hope that this post has been useful for you. It took me a few hours to walk through this process and it&amp;#8217;s how all of our designers and developers at &lt;a href="http://planetargon.com"&gt;&lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt;&lt;/a&gt; installs and configures their development environment.&lt;/p&gt;


	&lt;p&gt;We also install the following programs on new machines.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Subversion: &lt;code&gt;sudo port install subversion&lt;/code&gt;&lt;/li&gt;
		&lt;li&gt;RSpec: &lt;code&gt;sudo gem install -y rspec&lt;/code&gt;&lt;/li&gt;
		&lt;li&gt;...amongst other gems that are needed on specific projects&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Until next time&amp;#8230; have fun!&lt;/p&gt;


	&lt;p id="fn1"&gt;&lt;sup&gt;1&lt;/sup&gt; Rumor: Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; Leopard will give Terminal.app tabs! (&lt;a href="http://www.apple.com/macosx/leopard/technology/unix.html"&gt;see screenshot&lt;/a&gt;)&lt;/p&gt;</description>
      <pubDate>Tue, 19 Jun 2007 13:54:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:99f3a321-f222-4716-b70e-f62fcb7829c1</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/06/19/installing-ruby-on-rails-and-postgresql-on-os-x-second-edition</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PostgreSQL</category>
      <category>PLANET ARGON</category>
      <category>rails</category>
      <category>ruby</category>
      <category>postgresql</category>
      <category>subversion</category>
      <category>irb</category>
      <category>rubyonrails</category>
      <category>osx</category>
      <category>tutorial</category>
      <category>apple</category>
      <category>rubygems</category>
      <category>xcode</category>
      <category>macports</category>
      <category>macbook</category>
    </item>
    <item>
      <title>Put Your Controllers on a Diet already!</title>
      <description>&lt;p&gt;If you&amp;#8217;re working with Ruby on Rails and are looking for ways to improve your existing code base, I would encourage you all to read the following blog posts.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model"&gt;Skinny Controller, Fat Model&lt;/a&gt;, Jamis Buck&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://blog.imperialdune.com/2007/4/19/find-methods-in-controllers"&gt;Find methods in controllers&lt;/a&gt;, by Graeme Nelson&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://www.therailsway.com/2007/6/1/railsconf-recap-skinny-controllers"&gt;RailsConf Recap: Skinny Controllers&lt;/a&gt;, The Rails Way&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://blog.caboo.se/articles/2007/6/19/rspec-notes-from-the-trenches-2"&gt;Rspec notes from the trenches 2&lt;/a&gt;, by Courtenay&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Hopefully&amp;#8230; you&amp;#8217;ve already read each of them and as a result&amp;#8230; &lt;strong&gt;put your controllers on a diet&lt;/strong&gt;.&lt;/p&gt;
</description>
      <pubDate>Tue, 19 Jun 2007 08:16:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6e2fb984-1fd2-413e-ae3b-7c3a12a2889a</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/06/19/put-your-controllers-on-a-diet-already</link>
      <category>Ruby on Rails</category>
      <category>Programming</category>
      <category>models</category>
      <category>controllers</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>refactoring</category>
    </item>
    <item>
      <title>Rails Code Audits and Reviews, continued</title>
      <description>&lt;p&gt;In response to my article, &lt;a href="http://www.robbyonrails.com/articles/2007/06/17/audit-your-rails-development-team"&gt;Audit Your Rails Development Team&lt;/a&gt;, Tim Case writes,&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8220;I think what you are doing has value and I’ve been anticipating that someone in the rails community would step up and do this, hence the question I posed because I’ve thought about that thorny issue too. I have a feeling Planet Argon is making the first step in a direction that has been building, Peer review has the potential to be positive for the entire community, provided that it’s shepherded properly and with care.&amp;#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;It&amp;#8217;s been just over a year since &lt;a href="http://www.robbyonrails.com/articles/2006/05/14/planet-argon-monthly-newsletter-may-10-2006"&gt;we first made a public announcement&lt;/a&gt; of our Rails Code Audit and Review service and we&amp;#8217;ve had different types of clients inquire about it. We make sure to call it a code audit &lt;strong&gt;and&lt;/strong&gt; review because we&amp;#8217;re not aiming to only point out flaws. We see our service as a way to help stake holders gauge the capabilities of their developers while also providing developers with some more insight to how things could be done differently. There are a lot of developers using Ruby on Rails now and it&amp;#8217;s safe to say that there are many that aren&amp;#8217;t very good yet. Some may argue that the ease of getting started with Rails makes it easy for inexperienced developers to stay &lt;em&gt;just good enough&lt;/em&gt; and never take the next step. We&amp;#8217;ve seen some beautiful code and we&amp;#8217;ve seen some horrific code. Some of our clients have made the tough decision to fire their existing freelancers after we&amp;#8217;ve completed our analysis&amp;#8230; but we&amp;#8217;ve seen several situations where our clients were happier with their developers after.&lt;/p&gt;


	&lt;p&gt;For example, we recently completed a code audit and review for a client, which came to us with some concerns about their development team. Things seemed to be going slower than they thought it would and really wanted to have an outside opinion ab