<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Grasp Ruby on Rails - Blog</title>
  <id>tag:grasprubyonrails.com,2008:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.7.3">Mephisto Noh-Varr</generator>
  <link href="http://grasprubyonrails.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://grasprubyonrails.com/" rel="alternate" type="text/html"/>
  <updated>2008-01-25T14:24:09Z</updated>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>steve</name>
    </author>
    <id>tag:grasprubyonrails.com,2008-01-25:47</id>
    <published>2008-01-25T14:00:00Z</published>
    <updated>2008-01-25T14:24:09Z</updated>
    <link href="http://grasprubyonrails.com/2008/1/25/setup-ssl-on-your-slice-after-launching-with-deprec-a2enmod-not-found" rel="alternate" type="text/html"/>
    <title>Setup SSL on your Slice after Launching with Deprec - "a2enmod not found"</title>
<content type="html">
            &lt;p&gt;
I had to do a little digging, but setting up SSL on your server from Slicehost after &lt;a href=&quot;http://wiki.slicehost.com/doku.php?id=automated_rails_install_and_deployment_with_deprec_capistrano&quot;&gt;launching it with the Deprec gem&lt;/a&gt; is not so bad. The issues caused by deprec that make &lt;a href=&quot;http://articles.slicehost.com/2007/9/27/ubuntu-feisty-apache-ssl-and-vhosts&quot;&gt;these instructions for setting up SSL on Ubuntu Feisty&lt;/a&gt; not work are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Deprec install Apache2 to a non-standard location. Which means file locations are all mixed up.&lt;/li&gt;
&lt;li&gt;Deprec does not install the &lt;i&gt;a2enmod&lt;/i&gt; method for Apache. This causes an error (&quot;a2enmod not found&quot;) when it comes time to enable SSL in the Apache config files.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
No big deal, we can handle this. First step is to SSH into your slice and run the command
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install apache2.2-common&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Now you should have &lt;i&gt;a2enmod&lt;/i&gt; at your disposal. Follow all the instruction from the &lt;a href=&quot;http://articles.slicehost.com/2007/9/27/ubuntu-feisty-apache-ssl-and-vhosts&quot;&gt;SliceHost wiki for setting up SSL on Ubuntu Feisty with Apache&lt;/a&gt;, but with three caveats:
&lt;ol&gt;
&lt;li&gt;replace all references to &lt;pre&gt;&lt;code&gt;/etc/apache2&lt;/code&gt;&lt;/pre&gt; with &lt;pre&gt;&lt;code&gt;/usr/local/apache2&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;to restart Apache server, run &lt;pre&gt;&lt;code&gt;sudo /etc/init.d/httpd restart&lt;/code&gt;&lt;/pre&gt; instead of &lt;pre&gt;&lt;code&gt;sudo /etc/init.d/apache2 force-reload&lt;/code&gt;&lt;/pre&gt;
&lt;i&gt;Optionally, you may also run this from your home computer instead&lt;/i&gt;&lt;pre&gt;&lt;code&gt;cap apache_restart&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;you have no ports.conf, so add port 443 to your &lt;i&gt;httpd.conf&lt;/i&gt; &lt;pre&gt;&lt;code&gt;Listen 80&lt;br /&gt;Listen 443&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The rest of SliceHost's excellent tutorial with these minor tweaks should have you up and running in no time.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>steve</name>
    </author>
    <id>tag:grasprubyonrails.com,2008-01-21:45</id>
    <published>2008-01-21T16:33:00Z</published>
    <updated>2008-01-21T16:35:24Z</updated>
    <link href="http://grasprubyonrails.com/2008/1/21/how-to-install-a-mephisto-blog-on-your-rails-site-as-a-subdomain" rel="alternate" type="text/html"/>
    <title>How to Install a Mephisto Blog on your Rails Slice as a Subdomain</title>
<content type="html">
            &lt;p&gt;
In this article, I will show you how to install a Mephisto Blog on your server so that it is accessible through a subdomain such as &quot;blog.yoursite.com&quot;. While this tutorial is written specifically for installing Mephisto on a VPS Slice on Slicehost, I've divided it into sections so that the directions can be easily followed to install any blogging platform on any VPS or dedicated server that uses Apache and Mongrel.
&lt;/p&gt;
&lt;p&gt;
This took me about 7 hours and 3 beers to figure out and get working on my server (&lt;a href=&quot;http://www.ratemystudentrental.com&quot;&gt;RateMyStudentRental.com&lt;/a&gt;), but hopefully, with my help you'll be up and running in a mere half hour and 1 beer (provided you're not underage of course). And on to the tutorial!
&lt;/p&gt;
&lt;p&gt;
Basically, here are the steps that need to be performed:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install the blog on your computer and get it running as a separate application&lt;/li&gt;
&lt;li&gt;Open your first beer and get comfortable&lt;/li&gt;
&lt;li&gt;SSH into your server and set up a new svn repository for the app on your existing server right alongside the existing repository for your existing app&lt;/li&gt;
&lt;li&gt;Capify your new Mephisto blog on your computer (if you’re not using Capistrano, you’re really missing out)&lt;/li&gt;
&lt;li&gt;Import app from your computer into your repository, check it back out and deploy to server right alongside your existing app&lt;/li&gt;
&lt;li&gt;Configure Apache server to redirect subdomain traffic to the blog’s directory on the server rather than the directory of your existing app, using Virtual Hosts&lt;/li&gt;
&lt;li&gt;Drink one more beer to celebrate (or maybe hold off until after your first post)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Hopefully now you have a bit better idea of what we’re about to do. So, let’s do it now.
&lt;/p&gt;
&lt;h2&gt;1. Install blog and get it running on your computer as a separate app&lt;/h2&gt;
&lt;p&gt;
If you are going to use a platform other than Mephisto, follow the appropriate instructions to get it running on your computer and skip to Step 2.
&lt;/p&gt;
&lt;p&gt;
Now, for Mephisto, the &lt;a href=&quot;http:&quot; /&gt;install directions from their site&lt;/a&gt; are as follows:
&lt;/p&gt;
&amp;lt;quote&gt;
&lt;ol&gt;
&lt;li&gt;Create a database named mephisto (or one of your choosing). &lt;/li&gt;
&lt;li&gt;Copy config/database.example.yml to config/database.yml &lt;/li&gt;
&lt;li&gt;Edit database.yml and set your database credentials. &lt;/li&gt;
&lt;li&gt;Upload the entire mephisto directory to your webserver. &lt;/li&gt;
&lt;li&gt;Make sure you upload the tzinfo gem (see above) with the directory, or that your host has it preinstalled. &lt;/li&gt;
&lt;li&gt;Run rake db:bootstrap from a terminal of some sorts (use rake db:bootstrap RAILS_ENV=production to be sure you’ve bootstrapped the production database.)&lt;/li&gt;
&lt;/ol&gt;
&amp;lt;/quote&gt;
&lt;p&gt;
However, when I tried this, I had problems getting Step 6 to work. To solve the problem, I had to upgrade my rake, gems, and rails to the latest versions (rake 8.1, gems 1.0.1, and rails 2.02), using the following commands
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo gem update rake
sudo gem update
sudo gem update rails&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Oh and make sure the tzinfo gem is installed on both your computer and the server
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo gem install tzinfo&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Then I had to uninstall the stable version of Mephisto  (6.1) and instead install the latest and greatest build (7.2) from the Mephisto svn trunk repository
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svn co http://svn.techno-weenie.net/projects/mephisto/trunk&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Now go into your favorite mysql tool (or terminal) and create a new database for your blog. Then open up &lt;i&gt;database.sample.yml&lt;/i&gt; in the config folder and configure your database info to match your new database’s name, user and password, then save it as &lt;i&gt;database.yml&lt;/i&gt;. Go back to the directory of your app in terminal and run
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rake db:bootstrap&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Hopefully your tables got created properly. This is where all my original problems occurred though. If you are getting “no method found” or “permission denied” errors, make sure that you are using the latest rake and rails versions (some important changes happened between rake v7 and rake v8, same goes for Rails 1.2 and Rails 2.0 that will cause the bootstrap rake file to not execute properly with the former versions).
Now, you should be able to go to that directory in your terminal and get it running from your computer
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ruby script/server&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In your browser, navigate to &lt;a href=&quot;http://localhost:3000/admin&quot;&gt;http://localhost:3000/admin&lt;/a&gt;, login and make sure all is working.
&lt;/p&gt;
&lt;h2&gt;2. Get Beer&lt;/h2&gt;
&lt;p&gt;
Alright, you’re doing good. We’ve made some real progress, so it’s time to pop open that first beer. Remember though, we’re going for quality here, so it better be something good like Stella Artois or Guiness, none of that domestic crap.
&lt;/p&gt;
&lt;h2&gt;3. Setup SVN&lt;/h2&gt;
&lt;p&gt;
If you are using Slicehost as my app (www.ratemystudentrental.com) is, then hopefully you used the deprec gem along with Capistrano to deploy your original app. If you did, then rejoice, and skip to Step 4. If not, &lt;a href=&quot;http:&quot; /&gt; check out this wiki&lt;/a&gt; to get Capistrano and the deprec gem working. 
&lt;/p&gt;
&lt;p&gt;
Otherwise, you hopefully remember enough about your original deployment that you can do it again with this blog app. But basically, you will need to SSH into your server, navigate to the parent directory of your existing app, create a new directory for your blog right beside it, then &lt;a /&gt;create a svn repository&lt;/a&gt; for it right beside your existing app’s repository (wherever that is), svn import your blog into the new svn repository, and then check it back out to your computer.
&lt;/p&gt;
&lt;p&gt;
&lt;h2&gt;4. Capify your Blog App&lt;/h2&gt;
If Cap and deprec are already on your computer, issue the following command from your blog app directory in terminal
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd /path/to/railsapp
deprec --apply-to . --name projectname --domain yoursite.com&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Note that the domain is just &lt;i&gt;yoursite.com&lt;/i&gt;, not &lt;i&gt;blog&lt;/i&gt; or &lt;i&gt;blog.yoursite.com&lt;/i&gt;. Now, open up the newly created &lt;i&gt;config/deploy.rb&lt;/i&gt; and fill in the details. The lines you need to uncomment and fill in are:
&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;set &lt;span class=&quot;sy&quot;&gt;:domain&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;yoursite.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:application&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;projectname&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:deploy_to&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;absolute/path/to/your/new/project/on/server&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;yourusernameonserver&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;
Unless you already have an svn repository for your blog setup somewhere, uncomment this line too
&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;role &lt;span class=&quot;sy&quot;&gt;:scm&lt;/span&gt;, domain&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;
Then uncomment the appropriate apache and mongrel config lines as shown in my &lt;i&gt;deploy.rb&lt;/i&gt; file below. 
You may need to change the directory of your apache2 config files (you should probably SSH to your server, and look around to find out where your apache2 .conf files are). Mine are in &lt;i&gt;/usr/local/apache2/conf&lt;/i&gt;, though a lot of servers have them at &lt;i&gt;/etc/apache2/conf&lt;/i&gt;.
&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_conf&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/usr/local/apache2/conf/apps/&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;application&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.conf&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;
Make sure that you tell apache to serve your blog to different proxy ports than your existing app.
&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_proxy_port&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;4000&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;
My app was using the 8000 ports, so I put my blog on the 4000 ports. Also, change the number of mongrel instances to the appropriate value. You can typically count on 50-60MB of memory use per mongrel instance, so don’t overdo it. My app is running on a 512MB Slice at slicehost with 4 mongrel instances (4 x 60MB = 240MB). I figured 2 mongrels should be good enough for the Mephisto blog (2 x 60MB = 120MB). 240 + 120 = 360MB &amp;lt; 512 MB, so we’re good.
&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_proxy_servers&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;
Also, if you have a &lt;a href=&quot;”&quot; /&gt;SSH certificate&lt;/a&gt; set up on your computer, so that you don’t have to enter your username and  password into the terminal everytime you go to SSH into your server, you’ll need the following line added at the end with the path on your computer to your SSH certificate
&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;ssh_options[&lt;span class=&quot;sy&quot;&gt;:keys&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;%w(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/home/yourcomputerusername/.ssh/id_rsa&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;
Here is what my ‘deploy.rb’ looks like:
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;32&lt;tt&gt;
&lt;/tt&gt;33&lt;tt&gt;
&lt;/tt&gt;34&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;36&lt;tt&gt;
&lt;/tt&gt;37&lt;tt&gt;
&lt;/tt&gt;38&lt;tt&gt;
&lt;/tt&gt;39&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;40&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;41&lt;tt&gt;
&lt;/tt&gt;42&lt;tt&gt;
&lt;/tt&gt;43&lt;tt&gt;
&lt;/tt&gt;44&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;45&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;46&lt;tt&gt;
&lt;/tt&gt;47&lt;tt&gt;
&lt;/tt&gt;48&lt;tt&gt;
&lt;/tt&gt;49&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;50&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;51&lt;tt&gt;
&lt;/tt&gt;52&lt;tt&gt;
&lt;/tt&gt;53&lt;tt&gt;
&lt;/tt&gt;54&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;55&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;56&lt;tt&gt;
&lt;/tt&gt;57&lt;tt&gt;
&lt;/tt&gt;58&lt;tt&gt;
&lt;/tt&gt;59&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;60&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;61&lt;tt&gt;
&lt;/tt&gt;62&lt;tt&gt;
&lt;/tt&gt;63&lt;tt&gt;
&lt;/tt&gt;64&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;65&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;66&lt;tt&gt;
&lt;/tt&gt;67&lt;tt&gt;
&lt;/tt&gt;68&lt;tt&gt;
&lt;/tt&gt;69&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;70&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;71&lt;tt&gt;
&lt;/tt&gt;72&lt;tt&gt;
&lt;/tt&gt;73&lt;tt&gt;
&lt;/tt&gt;74&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;75&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;76&lt;tt&gt;
&lt;/tt&gt;77&lt;tt&gt;
&lt;/tt&gt;78&lt;tt&gt;
&lt;/tt&gt;79&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;80&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;81&lt;tt&gt;
&lt;/tt&gt;82&lt;tt&gt;
&lt;/tt&gt;83&lt;tt&gt;
&lt;/tt&gt;84&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;85&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;86&lt;tt&gt;
&lt;/tt&gt;87&lt;tt&gt;
&lt;/tt&gt;88&lt;tt&gt;
&lt;/tt&gt;89&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;90&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;require &amp;lt;i&amp;gt;deprec/recipes&amp;lt;&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;i&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;# =============================================================================&lt;tt&gt;
&lt;/tt&gt;# ROLES&lt;tt&gt;
&lt;/tt&gt;# =============================================================================&lt;tt&gt;
&lt;/tt&gt;# You can define any number of roles, each of which contains any number of&lt;tt&gt;
&lt;/tt&gt;# machines. Roles might include such things as :web, or :app, or :db, defining&lt;tt&gt;
&lt;/tt&gt;# what the purpose of each machine is. You can also specify options that can&lt;tt&gt;
&lt;/tt&gt;# be used to single out a specific subset of boxes in a particular role, like&lt;tt&gt;
&lt;/tt&gt;# :primary =&amp;gt; true.&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;set :domain, &amp;quot;ratemystudentrental.com&amp;quot;&lt;tt&gt;
&lt;/tt&gt;role :web, domain&lt;tt&gt;
&lt;/tt&gt;role :app, domain&lt;tt&gt;
&lt;/tt&gt;role :db,  domain, :primary =&amp;gt; true&lt;tt&gt;
&lt;/tt&gt;role :scm, domain&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;# =============================================================================&lt;tt&gt;
&lt;/tt&gt;# REQUIRED VARIABLES&lt;tt&gt;
&lt;/tt&gt;# =============================================================================&lt;tt&gt;
&lt;/tt&gt;# You must always specify the application and repository for every recipe. The&lt;tt&gt;
&lt;/tt&gt;# repository must be the URL of the repository you want this recipe to&lt;tt&gt;
&lt;/tt&gt;# correspond to. The deploy_to path must be the path on each machine that will&lt;tt&gt;
&lt;/tt&gt;# form the root of the application path.&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;set :application, &amp;quot;msrblog&amp;quot;&lt;tt&gt;
&lt;/tt&gt;set :deploy_to, &amp;quot;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;var/www/apps/&lt;span class=&quot;c&quot;&gt;#{application}&amp;quot;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# XXX we may not need this - it doesn't work on windows&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;yourserverusername&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:repository&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;svn+ssh://&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;user&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;domain&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;deploy_to&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/repos/trunk&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:rails_env&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;production&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# Automatically symlink these directories from current/public to shared/public.&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :app_symlinks, %w{photo, document, asset}&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# SPECIAL OPTIONS&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# These options allow you to tweak deprec behaviour&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# If you do not keep database.yml in source control, set this to false.&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# After new code is deployed, deprec will symlink current/config/database.yml &lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# to shared/config/database.yml&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# You can generate shared/config/database.yml with 'cap generate_database_yml'&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :database_yml_in_scm, true&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# APACHE OPTIONS&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_server_name&lt;/span&gt;, domain&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :apache_server_aliases, %w{alias1 alias2}&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :apache_default_vhost, true # force use of apache_default_vhost_config&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :apache_default_vhost_conf, &amp;quot;/usr/local/apache2/conf/default.conf&amp;quot;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_conf&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/usr/local/apache2/conf/apps/&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;application&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.conf&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_ctl&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/etc/init.d/httpd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_proxy_port&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;4000&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_proxy_servers&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:apache_proxy_address&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;127.0.0.1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :apache_ssl_enabled, false&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :apache_ssl_ip, &amp;quot;127.0.0.1&amp;quot;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :apache_ssl_forward_all, false&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :apache_ssl_chainfile, false&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# MONGREL OPTIONS&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:mongrel_servers&lt;/span&gt;, apache_proxy_servers&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:mongrel_port&lt;/span&gt;, apache_proxy_port&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:mongrel_address&lt;/span&gt;, apache_proxy_address&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:mongrel_environment&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;production&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:mongrel_config&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/etc/mongrel_cluster/&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;application&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.conf&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :mongrel_user_prefix,  'mongrel_'&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :mongrel_user, mongrel_user_prefix + application&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :mongrel_group_prefix,  'app_'&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# set :mongrel_group, mongrel_group_prefix + application&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# MYSQL OPTIONS&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# SSH OPTIONS&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# =============================================================================&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;ssh_options[&lt;span class=&quot;sy&quot;&gt;:keys&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;%w(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/home/yourcomputerusername/.ssh/id_rsa&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# ssh_options[:port] = 25&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;h2&gt;5. Migrate Blog to Server&lt;/h2&gt;
&lt;p&gt;
And now for the exciting part, migrating everything to your server. Don’t forget to really enjoy your beer throughout this step, but pace yourself. You don’t want to be incoherent while playing around with your server. In your terminal from the directory of your blog app, run this command
&lt;pre&gt;&lt;code&gt;cap setup&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Now, if you did not already have a svn repo somewhere, run this command to set that up on your server
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cap setup_scm&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Your terminal should have spit out the address to your new svn repo. At this point, navigate to the directory of your blog app on your computer and go one level above. You should have a new folder now called &lt;i&gt;projectname_machine&lt;/i&gt; or &lt;i&gt;projectname.test&lt;/i&gt; or something like that (I don’t remember exactly). Anyway, that is now your new working directory. You can safely delete your original directory &lt;i&gt;projectname&lt;/i&gt; folder from your computer or archive it, and rename the new directory back to &lt;i&gt;projectname&lt;/i&gt;.
&lt;/p&gt;
&lt;p&gt;
Now go into the new directory, reopen &lt;i&gt;config/deploy.rb&lt;/i&gt;, and replace the line
&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;set &lt;span class=&quot;sy&quot;&gt;:repository&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;svn+ssh://&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;user&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;domain&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;deploy_to&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/repos/trunk&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;
with the new explicit path that terminal gave you for the svn address (basically, the variables will just be replaced with their actual values).
&lt;hr /&gt;&lt;h3&gt;Mephisto-specific&lt;/h3&gt;
If you are using Mephisto, go back to terminal and issue
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cap deploy&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
You will now need to SSH into your server. Navigate to the current directory of your newly deployed blog app, and issue the command
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rake db:bootstrap RAILS_ENV=production&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Again, if you have problems, make sure that your server also has completely updated rake, gems, and Rails as you did with your computer. Your blog app should now be on your server and under revision control. 
&lt;/p&gt;
&lt;hr /&gt;&lt;h3&gt;Non-Mephiso instructions&lt;/h3&gt;
&lt;p&gt;
Note that if you’re using a blog platform other than Mephisto, you’ll instead run
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cap deploy_with_migrations&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;assuming you have the blog app running on your computer with the proper tables and migrations set up.&lt;/p&gt;
&lt;hr /&gt;&lt;h3&gt;Now, Everybody!&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;cap restart_apache
cap restart mongrel_cluster&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;6. Configure Apache2&lt;/h2&gt;
&lt;p&gt;
You should now be about ¾ done with your beer by this time. Put your beer aside for this step, because it can be a little confusing, and differs depending on your exact server setup and configuration. My server is running Ubuntu 7.04 Feisty with Apache2 and Mongrel, so that’s what I’ll be dealing with specifically here.
&lt;/p&gt;
&lt;p&gt;
The idea is that you’re going to be modifying your server’s configuration files so that it knows to look at the HTTP header of incoming requests and route requests of the appropriate subdomain to the directory of your blog app rather than your main app. Technically, what we’re doing is setting up a Name-based Virtual Host. You can read more about &lt;a href=&quot;”&quot; /&gt;name-based vhosting here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
First, find your Apache2’s &lt;i&gt;httpd.conf&lt;/i&gt; file. Most of the time you can find it in &lt;i&gt;/etc/apache2/conf&lt;/i&gt;, but my server was setup by deprec, which put it in &lt;i&gt;/usr/local/apache2/conf&lt;/i&gt;. In this directory, look to see if you have a folder called &lt;i&gt;apps&lt;/i&gt;. If you do, then go in there and you should have two &lt;i&gt;.conf&lt;/i&gt; with the titles of your original app and your new blog app. Deprec did that for you.
&lt;/p&gt;
&lt;p&gt;
If you didn’t use deprec, then you’ll just have the original one, which you will need to copy and rename the copy to your blog app name. Either way, now you open up the &lt;i&gt;projectname.conf&lt;/i&gt; file and change the following lines:
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ServerName www.yoursite.com
DocumentRoot /var/www/apps/projectname/current/public&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
To
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ServerName blog.yoursite.com
DocumentRoot /var/www/apps/projectname/current/public &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Also, if you have any &lt;i&gt;ServerAlias&lt;/i&gt; lines, delete those.
&lt;/p&gt;
&lt;p&gt;
If you did not already have this file and copied it over, you will need to go back into your &lt;i&gt;conf&lt;/i&gt; directory, open up &lt;i&gt;httpd.conf&lt;/i&gt; and tell it to look for the new &lt;i&gt;projectname.conf&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;
For more help setting up your &lt;i&gt;.conf&lt;/i&gt; file, check out &lt;a href=&quot;”&quot; /&gt;this code for setting up Mephisto to work with multiple sites&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
If you did not have an &lt;i&gt;apps&lt;/i&gt; folder in &lt;i&gt;/usr/local/apache2/conf&lt;/i&gt;, then you will need to add this to your &lt;i&gt;httpd.conf&lt;/i&gt;.
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;virtualhost&gt;
ServerName blog.yoursite.com
DocumentRoot /var/www/apps/projectname/current/public
&amp;lt;/virtualhost&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
The ‘*’ above may also be your specific IP address, but on anything after apache 1.3.12, ‘*’ works just fine.
Now all you have to do is add an A Record to tell the interwebs to send all requests for your new subdomain to your IP address. You may need to find out how to do this with your server peeps.
&lt;a href=&quot;”&quot; /&gt;Here’s a good resource for messing with DNS Records&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
For Slicehost, this is how you do it… go to manage.slicehost.com and login to your account. Go to the &lt;i&gt;DNS&lt;/i&gt; tab. Go to &lt;i&gt;Records&lt;/i&gt; for your domain. Click &lt;i&gt;new record&lt;/i&gt;. Now, you’re going to set up a new A Record. In the ‘Name’ box, enter the subdomain that is setup for your blog in the apache2 &lt;i&gt;.conf&lt;/i&gt; file. Mine is &lt;i&gt;blog&lt;/i&gt;. In &lt;i&gt;Data&lt;/i&gt;, enter your IP address. Then make the other to entries match whatever the numbers are for your &lt;i&gt;www&lt;/i&gt; A Record that should already be set up for your Slice. My numbers are 0 and 3600 respectively. Then add it and you should be in business!
&lt;/p&gt;
&lt;p&gt;
Navigate to &lt;i&gt;subdomain.yoursite.com/admin&lt;/i&gt; login. If you get any Mephisto errors, you might have a problem with folder permissions on your server. If this is the case, SSH into your server, navigate to &lt;i&gt;projectname/current&lt;/i&gt;, and issue the command:
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo chmod –R 777 public&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You may also need to do this for your themes directory if you plan on modifying your themes at all
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo chmod –R 777 themes&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;7. W00t!&lt;/h2&gt;
&lt;p&gt;
Now you’re done! Chug the rest of that beer, write your ‘Hello World’ blog post and take the rest of the night off!
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>vance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-10-10:38</id>
    <published>2007-10-10T20:12:00Z</published>
    <updated>2007-10-10T20:22:32Z</updated>
    <category term="FastCGI"/>
    <category term="IIS"/>
    <category term="Microsoft"/>
    <category term="rails"/>
    <category term="Rails"/>
    <category term="ruby"/>
    <category term="Ruby"/>
    <link href="http://grasprubyonrails.com/2007/10/10/official-ruby-on-rails-support-on-microsoft-iis-with-fastcgi-extension" rel="alternate" type="text/html"/>
    <title>Official: Ruby on Rails Support on Microsoft IIS with FastCGI Extension</title>
<content type="html">
            &lt;p&gt;Microsoft has just &lt;a href=&quot;http://www.iis.net/php&quot;&gt;announced&lt;/a&gt; full FastCGI support for it's websever software - Internet Information Services (IIS).  Though primarily a PHP announcement (the FastCGI Extension was developed by Microsoft in partnership with Zend), it does offer Ruby developers a glimmer of hope for running Ruby on Rails on Windows servers.&lt;/p&gt;

&lt;blockquote&gt;
&quot;By supporting the open standard, Microsoft has made it possible for PHP and other CGI compliant languages to be hosted efficiently and effectively on Windows Server 2003 and IIS.&quot;
&lt;/blockquote&gt;

&lt;p&gt;The important part here for Rails developers is in the middle of that statement - &lt;strong&gt;and other CGI compliant languages&lt;/strong&gt;.  We find from reading the &lt;a href=&quot;http://www.iis.net/articles/view.aspx/IIS7/Hosting-Web-Applications/PHP/Using-FastCGI-to-Host-PHP-Applications-on-IIS-6-0-&quot;&gt; Using FastCGI to Host PHP Applications on IIS 6.0 and IIS 5.1&lt;/a&gt; guide on the same website under the &quot;What is FastCGI?&quot; heading that:&lt;/p&gt;

&lt;blockquote&gt;
&quot;The IIS FastCGI support enables IIS to host normal CGI programs like PHP, or Ruby On Rails, using the FastCGI protocol, offering high-performance and stability for production deployment of such application frameworks.&quot;
&lt;/blockquote&gt;

&lt;p&gt;This new FastCGI Extension will be available for webhosts to use on older versions of IIS 6 and 5.1, so there will be no excuse anymore for Windows hosts not to support Ruby on Rails.&lt;/p&gt;

&lt;blockquote&gt;
&quot;This FastCGI Extension release is supported on IIS 6 on Windows Server 2003 for a fully scalable production environment and on IIS 5.1 on Windows XP in order to support developers who build their Web applications on Windows client machines.&quot;
&lt;/blockquote&gt;

&lt;p&gt;At the end of the article lies the true gem:&lt;/p&gt;

&lt;blockquote&gt;
&quot;Looking ahead, betas of Windows Server 2008, already include the FastCGI Extension as a completely integrated feature of Internet Information Services IIS 7.0 (IIS7).&quot;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;This means the capability to run Ruby and Ruby on Rails (via the FastCGI extension) will be available on IIS out of the box, in all future versions.&lt;/strong&gt;  May Ruby on Rails developers around the world rejoice.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-09-21:32</id>
    <published>2007-09-21T21:22:00Z</published>
    <updated>2007-09-21T21:40:28Z</updated>
    <category term="activerecord"/>
    <category term="DRY"/>
    <category term="exceptions"/>
    <category term="rails"/>
    <category term="Rails"/>
    <link href="http://grasprubyonrails.com/2007/9/21/raising-errors-in-controllers" rel="alternate" type="text/html"/>
    <title>Raising errors in controllers</title>
<content type="html">
            All the cool people raise errors now in their controllers and models as opposed to using save and checking to see if it returned nil or the object we're dealing with. For example, in the create action, you would having something like this:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;create&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;iv&quot;&gt;@book&lt;/span&gt; = &lt;span class=&quot;co&quot;&gt;Book&lt;/span&gt;.new params[&lt;span class=&quot;sy&quot;&gt;:book&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;iv&quot;&gt;@book&lt;/span&gt;.save!&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  flash[&lt;span class=&quot;sy&quot;&gt;:notice&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Book was successfully created.&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  redirect_to &lt;span class=&quot;iv&quot;&gt;@book&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


By doing this, you can stick this in your application controller (extracted from Beast):

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;  private&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;rescue_action&lt;/span&gt;(exception)&lt;tt&gt;
&lt;/tt&gt;      exception.is_a?(&lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;RecordInvalid&lt;/span&gt;) ? render_invalid_record(exception.record) : &lt;span class=&quot;r&quot;&gt;super&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;render_invalid_record&lt;/span&gt;(record)&lt;tt&gt;
&lt;/tt&gt;      render &lt;span class=&quot;sy&quot;&gt;:action&lt;/span&gt; =&amp;gt; (record.new_record? ? &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; : &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;edit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


And any create controller that raises and ActiveRecord::RecordInvalid exception will directly to the new view. The same applies for the update controller:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;update&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;iv&quot;&gt;@book&lt;/span&gt; = &lt;span class=&quot;co&quot;&gt;Book&lt;/span&gt;.find params[&lt;span class=&quot;sy&quot;&gt;:id&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;iv&quot;&gt;@book&lt;/span&gt;.update_attributes! params[&lt;span class=&quot;sy&quot;&gt;:book&lt;/span&gt;] &lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  flash[&lt;span class=&quot;sy&quot;&gt;:notice&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Book was successfully updated.&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  redirect_to &lt;span class=&quot;iv&quot;&gt;@book&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


When a PUT is made, it is sent to the update method in your controller and then book will render to the edit view because of the line of code we stuck in our application controller:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;render &lt;span class=&quot;sy&quot;&gt;:action&lt;/span&gt; =&amp;gt; (record.new_record? ? &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; : &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;edit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


This DRYs up controllers significantly as it gets rid of all the render :action =&gt; 'new' and render :action =&gt; 'edit' lines I used to see all over my code. 

Raising exceptions is also good for show, edit, update and destroy actions. By utilizing the find method and supplying it with a single parameter ID, it will raise an ActiveRecord::RecordNotFound exception. In rails edge, it will rescue this exception and automatically redirect to the default 404 page located in public/404.html and give the client the appropriate 404 status. Try it out on your controllers and feel the DRYness!
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-09-17:28</id>
    <published>2007-09-17T13:52:00Z</published>
    <updated>2007-09-17T14:03:37Z</updated>
    <category term="generators"/>
    <category term="howto"/>
    <category term="migrations"/>
    <category term="rails"/>
    <category term="Rails"/>
    <link href="http://grasprubyonrails.com/2007/9/17/how-to-undo-script-generate-migration" rel="alternate" type="text/html"/>
    <title>how to undo script/generate migration</title>
<content type="html">
            The title of this post is the exact search I found on Google recently that pointed to my site. It forwards to places that don't really answer this question.. so I thought I'd answer it quickly. script/generate migration will show you what files it generates in the console (and any generation script for that matter) so you can look through the list of files it generates and delete them manually. As far as I know, there is no reverse for this generator (or any generators for that matter) and you must manually remove the files it created one-by-one. I hope this answers the anonymous Googler's question (and you come back here to find the answer)!
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-09-17:26</id>
    <published>2007-09-17T08:22:00Z</published>
    <updated>2007-09-17T08:31:39Z</updated>
    <category term="autotest"/>
    <category term="rails"/>
    <category term="Rails"/>
    <category term="rspec"/>
    <category term="tdd"/>
    <link href="http://grasprubyonrails.com/2007/9/17/rspec-and-autotest" rel="alternate" type="text/html"/>
    <title>Rspec and autotest</title>
<content type="html">
            &lt;p&gt;I thought I&#8217;d mention this briefly as rspec is becoming a very popular way to test. I was manually running my tests until I was recently pointed in the direction of auto-test with spec_server. This significantly increases the feedback loop for when your tests pass and fail; increasing productivity exponentially. The steps are as follows:&lt;/p&gt;


	&lt;p&gt;Install ZenTest:&lt;/p&gt;


	&lt;p&gt;sudo gem install ZenTest&lt;/p&gt;


	&lt;p&gt;Install rspec for rails:&lt;/p&gt;


	&lt;p&gt;http://rspec.rubyforge.org/documentation/rails/install.html&lt;/p&gt;


	&lt;p&gt;Open up a terminal and open run script/spec_server from the root of your rails application. Then open up another terminal and run autotest -rails (also inside of the root of the rails application). Edit a spec to make it fail, save it and watch autotest tell you it failed! I know you can get this to work with growl (I&#8217;m on Ubuntu so I don&#8217;t use growl). If someone with &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; experience can comment on how to get growl integrated and perhaps provide an alternative for linux, I will post it up.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-30:14</id>
    <published>2007-08-30T14:00:00Z</published>
    <updated>2007-08-30T14:04:33Z</updated>
    <category term="bdd"/>
    <category term="rbehave"/>
    <category term="rspec"/>
    <category term="stories"/>
    <category term="tdd"/>
    <link href="http://grasprubyonrails.com/2007/8/30/story-runner-in-rspec-sneak-peek" rel="alternate" type="text/html"/>
    <title>Story Runner in RSpec Sneak Peek</title>
<content type="html">
            David Chelimsky announced today that an experimental version of the story runner for rspec has been committed to the trunk. This move is clearing the path which rspec is taking towards merging the rspec and rbehave frameworks. The code example he gave for this new feature is below:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;32&lt;tt&gt;
&lt;/tt&gt;33&lt;tt&gt;
&lt;/tt&gt;34&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;36&lt;tt&gt;
&lt;/tt&gt;37&lt;tt&gt;
&lt;/tt&gt;38&lt;tt&gt;
&lt;/tt&gt;39&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;40&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;41&lt;tt&gt;
&lt;/tt&gt;42&lt;tt&gt;
&lt;/tt&gt;43&lt;tt&gt;
&lt;/tt&gt;44&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;45&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;46&lt;tt&gt;
&lt;/tt&gt;47&lt;tt&gt;
&lt;/tt&gt;48&lt;tt&gt;
&lt;/tt&gt;49&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;50&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;51&lt;tt&gt;
&lt;/tt&gt;52&lt;tt&gt;
&lt;/tt&gt;53&lt;tt&gt;
&lt;/tt&gt;54&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;55&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;56&lt;tt&gt;
&lt;/tt&gt;57&lt;tt&gt;
&lt;/tt&gt;58&lt;tt&gt;
&lt;/tt&gt;59&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;60&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# The following is based on an experimental Rails-Story adapter&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# in RSpec's trunk at rev2480.&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# You run it by standing in RAILS_ROOT and saying:&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#   &amp;gt;ruby stories/add_person.rb&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# Please forgive the lack of RESTful convention (get '/people/create' instead of '/people/new') -&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# this works with the existing example app, which is, well, OLD.&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# in RAILS_ROOT/stories/helper.rb&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;co&quot;&gt;ENV&lt;/span&gt;[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;RAILS_ENV&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;require &lt;span class=&quot;co&quot;&gt;File&lt;/span&gt;.expand_path(&lt;span class=&quot;co&quot;&gt;File&lt;/span&gt;.dirname(&lt;span class=&quot;pc&quot;&gt;__FILE__&lt;/span&gt;) + &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/../config/environment&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;spec/rails/story_adapter&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# in RAILS_ROOT/stories/add_person.rb&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;require &lt;span class=&quot;co&quot;&gt;File&lt;/span&gt;.join(&lt;span class=&quot;co&quot;&gt;File&lt;/span&gt;.dirname(&lt;span class=&quot;pc&quot;&gt;__FILE__&lt;/span&gt;), &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;co&quot;&gt;Story&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Add Person&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;%{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&lt;tt&gt;
&lt;/tt&gt;  As an admin&lt;tt&gt;
&lt;/tt&gt;  I want to add people to the system&lt;tt&gt;
&lt;/tt&gt;  So that I show how many people use my system&lt;tt&gt;
&lt;/tt&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:type&lt;/span&gt; =&amp;gt; &lt;span class=&quot;co&quot;&gt;RailsStory&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;co&quot;&gt;Scenario&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Successfully add person&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;Given&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;no people in the system&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;co&quot;&gt;Person&lt;/span&gt;.destroy_all&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;When&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;creating a new person named&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Dan&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |name|&lt;tt&gt;
&lt;/tt&gt;      post &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/people/create&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:person&lt;/span&gt; =&amp;gt; {&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; =&amp;gt; name}&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;viewer should see&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/people/list&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      follow_redirect!&lt;tt&gt;
&lt;/tt&gt;      response.should render_template(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;people/list&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;list should include&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Dan&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      response.should have_text(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Dan&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;co&quot;&gt;Scenario&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Redirect to create form on failed create&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;Given&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;no people in the system&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;co&quot;&gt;Person&lt;/span&gt;.destroy_all&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;When&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;creating a new person with no name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      post &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/people/create&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:person&lt;/span&gt; =&amp;gt; {&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt;}&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;viewer should see&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/people/create&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      assert_template &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;people/create&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;list should not include&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Dan&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      response.should_not have_text(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Dan&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-29:13</id>
    <published>2007-08-29T15:50:00Z</published>
    <updated>2007-08-29T15:53:38Z</updated>
    <category term="conference"/>
    <category term="presentation"/>
    <category term="ruby"/>
    <category term="rubyhoedown"/>
    <link href="http://grasprubyonrails.com/2007/8/29/ruby-hoedown" rel="alternate" type="text/html"/>
    <title>Ruby hoedown</title>
<content type="html">
            &lt;p&gt;mmmm I love conferences. Below is a link to some (or all?) presentations at Ruby Hoedown.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://rubyhoedown2007.confreaks.com/&quot;&gt;http://rubyhoedown2007.confreaks.com/&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-28:11</id>
    <published>2007-08-28T20:36:00Z</published>
    <updated>2007-08-28T21:04:00Z</updated>
    <category term="migrations"/>
    <category term="rails"/>
    <category term="ruby"/>
    <category term="syntactic sugar"/>
    <link href="http://grasprubyonrails.com/2007/8/28/adding-type-to-a-table-in-migrations" rel="alternate" type="text/html"/>
    <title>Adding type to a table in migrations</title>
<content type="html">
            I just ran 

&lt;pre&gt;&lt;code&gt;script/generate migration add_type_to_users&lt;/code&gt;&lt;/pre&gt;

in my terminal and it automatically generated a migration with the code generated for me.

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;AddTypeToUsers&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.up&lt;tt&gt;
&lt;/tt&gt;    add_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:type&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:type&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:null&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:no?&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:default&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:maybe?&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.down&lt;tt&gt;
&lt;/tt&gt;    remove_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:type&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;p&gt;Am I being n00b, or is this a new feature in edge rails? Does this work for columns not reserved for rails?&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;UPDATE:&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;On further inspection, this is a new thing in edge rails and it does work for other columns. While running the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;script/generate migration add_name_to_users&lt;/code&gt;&lt;/pre&gt;

I got the following migration:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;AddNameToUsers&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.up&lt;tt&gt;
&lt;/tt&gt;    add_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:type&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:null&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:no?&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:default&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:maybe?&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.down&lt;tt&gt;
&lt;/tt&gt;    remove_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


For a bit more experimentation I tried:

&lt;pre&gt;&lt;code&gt;script/generate migration add_name_string_to_users&lt;/code&gt;&lt;/pre&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;AddNameStringToUsers&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.up&lt;tt&gt;
&lt;/tt&gt;    add_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:name_string&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:type&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:null&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:no?&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:default&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:maybe?&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.down&lt;tt&gt;
&lt;/tt&gt;    remove_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:name_string&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


Unfortunately it seems you cannot specify type. I also tried to see if you could do multiple columns by trying:

&lt;pre&gt;&lt;code&gt;script/generate migration add_name_and_date_to_users&lt;/code&gt;&lt;/pre&gt;

and got the following:

&lt;pre&gt;&lt;code&gt;class AddNameAndDateToUsers &amp;lt; ActiveRecord::Migration
  def self.up
    add_column :users, :name_and_date, :type, :null =&gt; :no?, :default =&gt; :maybe?
  end

  def self.down
    remove_column :users, :name_and_date
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
It seems that the implementation is pretty primitive. Obviously I'm using a bad approach as I should be looking at the source to see if any additional implementation does exist without my knowing, but I was hoping that the most intuitive thing for me would implemented already. I think it would be cool to see this syntactic sugar get more advanced. Comments? Opinions?
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;NOTE:&lt;/b&gt; The code that is generated by the migration does not work automatically. You have to change the stubbed symbols placed inside the migration to whatever you need. It's more of a guide than a performance enhancer (which IMO think that it should be both).
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-28:10</id>
    <published>2007-08-28T03:48:00Z</published>
    <updated>2007-08-30T22:13:08Z</updated>
    <category term="migrations"/>
    <category term="phpmyadmin"/>
    <category term="rails"/>
    <category term="ruby"/>
    <link href="http://grasprubyonrails.com/2007/8/28/importing-phpmyadmin-export-files-using-migrations" rel="alternate" type="text/html"/>
    <title>Importing PHPMyAdmin export files using migrations</title>
<content type="html">
            &lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.up&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;iv&quot;&gt;@first_query&lt;/span&gt; = &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  sql_file = &lt;span class=&quot;co&quot;&gt;File&lt;/span&gt;.dirname(&lt;span class=&quot;pc&quot;&gt;__FILE__&lt;/span&gt;) + &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/../some_crazy_file.sql&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;co&quot;&gt;IO&lt;/span&gt;.readlines(sql_file).join.split(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;INSERT INTO &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;).each &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |q|&lt;tt&gt;
&lt;/tt&gt;    q = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;INSERT INTO &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + q &lt;span class=&quot;r&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;iv&quot;&gt;@first_query&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    execute q&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;iv&quot;&gt;@first_query&lt;/span&gt; = &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


Is there a better way? I have found that this is also very picky. Your insert queries must follow up the line right after. It would was fun to create this, but not fun to look at :-/. Maybe there is a plugin somewhere?

&lt;p&gt;&lt;b&gt;UPDATE:&lt;/b&gt; My friend Brandon, who chose not to comment on this blog post (shame on him!) said that running the sql file in command line could work as a more elegant solution there. The only problem I have with this approach is whether or not the rake task fails if the operation fails. So you code would like like this:&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.up&lt;tt&gt;
&lt;/tt&gt;  result = &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;mysql db_name &amp;lt; some_crazy_file.sql&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;p&gt;The only thing left is to make sure that result returns a favorable result, and if it doesn't then fail the migration. I'm not exactly sure how to do this (to busy to investigate). Any takers?&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-16:8</id>
    <published>2007-08-16T21:53:00Z</published>
    <updated>2007-09-12T20:30:19Z</updated>
    <category term="anvil"/>
    <category term="mvc"/>
    <category term="render"/>
    <category term="ruby"/>
    <category term="Ruby"/>
    <link href="http://grasprubyonrails.com/2007/8/16/mvc-support-and-view-rendering-in-anvil" rel="alternate" type="text/html"/>
    <title>MVC Support and view rendering in Anvil</title>
<content type="html">
            Anvil is growing rapidly and keeps getting cooler everyday! It now has support for MVC architecture (models are missing right now, but will be implemented soon) and it boasts a cool new way to shuffle away some of the code in your application view to other views like partials in rails. From the example I posted in the &lt;a href=&quot;http://grasprubyonrails.com/2007/8/13/anvil-the-ruby-application-framework&quot;&gt;previous post&lt;/a&gt;, you can now do:

&lt;br /&gt;&lt;br /&gt;
app/views/application.rb

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;anvil &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hammer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |app|&lt;tt&gt;
&lt;/tt&gt;  app.frame &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hamr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:render&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hamr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:title&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hamr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:maximize&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


app/views/frames/hamr_frame.rb

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Create Menu Bar&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;frame.menu_bar &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Main&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |menu_bar|&lt;tt&gt;
&lt;/tt&gt;  menu_bar.menu &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&amp;amp;File&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:render&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  menu_bar.menu &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&amp;amp;Edit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:render&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;edit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  menu_bar.menu &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&amp;amp;Search&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:render&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  menu_bar.menu &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&amp;amp;Help&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:render&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;frame.text_control &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Editor&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;sy&quot;&gt;:size&lt;/span&gt; =&amp;gt; { &lt;span class=&quot;sy&quot;&gt;:width&lt;/span&gt; =&amp;gt; &lt;span class=&quot;i&quot;&gt;100&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:height&lt;/span&gt; =&amp;gt; &lt;span class=&quot;i&quot;&gt;200&lt;/span&gt; }, &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;sy&quot;&gt;:style&lt;/span&gt; =&amp;gt; [ &lt;span class=&quot;sy&quot;&gt;:multiline&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:rich&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:rich2&lt;/span&gt; ]&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;frame.create_status_bar(&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;frame.set_status_text(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hamr World!&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


app/views/menus/file_menu.rb

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;item.add(&lt;span class=&quot;sy&quot;&gt;:new&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;item.add(&lt;span class=&quot;sy&quot;&gt;:open&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;item.separator&lt;tt&gt;
&lt;/tt&gt;item.add(&lt;span class=&quot;sy&quot;&gt;:save&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;item.separator&lt;tt&gt;
&lt;/tt&gt;item.add(&lt;span class=&quot;sy&quot;&gt;:preview&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;item.add(&lt;span class=&quot;sy&quot;&gt;:print&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;item.separator&lt;tt&gt;
&lt;/tt&gt;item.add(&lt;span class=&quot;sy&quot;&gt;:close&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;item.add(&lt;span class=&quot;sy&quot;&gt;:quit&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


This new way makes your code much neater. Support for putting all of the code into your application.rb file is still there, but having the ability to shuffle it away is very nice. Anyway, check out the projects: &lt;a href=&quot;http://anvil.rubyforge.org&quot;&gt;anvil.rubyforge.org&lt;/a&gt; and &lt;a href=&quot;http://hamr.rubyforge.org&quot;&gt;hamr.rubyforge.org&lt;/a&gt;.
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-13:6</id>
    <published>2007-08-13T15:10:00Z</published>
    <updated>2007-09-12T20:30:42Z</updated>
    <category term="anvil"/>
    <category term="hammer"/>
    <category term="rails"/>
    <category term="Rails"/>
    <category term="ruby"/>
    <category term="Ruby"/>
    <category term="wxruby"/>
    <category term="wxwidgets"/>
    <link href="http://grasprubyonrails.com/2007/8/13/anvil-the-ruby-application-framework" rel="alternate" type="text/html"/>
    <title>Anvil: The Ruby Application Framework</title>
<content type="html">
            &lt;a href=&quot;http://anvil.rubyforge.org&quot;&gt;Anvil&lt;/a&gt; just announced its conception onto rubyforge yesterday as plans are being set to organize how the new gem is going to be created. The gem is going to be a framework that wraps around the Wx::Ruby project in a way that is more concise and ruby-esk. The concepts are inspired by ruby on rails and Shoes (a project for allowing you to create little applications that act like web browsers). Here is a sample of the some of the code from the sample application called Hammer, a ruby/anvil-based text editor included in the applications folder of the repository:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;32&lt;tt&gt;
&lt;/tt&gt;33&lt;tt&gt;
&lt;/tt&gt;34&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;36&lt;tt&gt;
&lt;/tt&gt;37&lt;tt&gt;
&lt;/tt&gt;38&lt;tt&gt;
&lt;/tt&gt;39&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;40&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;41&lt;tt&gt;
&lt;/tt&gt;42&lt;tt&gt;
&lt;/tt&gt;43&lt;tt&gt;
&lt;/tt&gt;44&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;45&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;46&lt;tt&gt;
&lt;/tt&gt;47&lt;tt&gt;
&lt;/tt&gt;48&lt;tt&gt;
&lt;/tt&gt;49&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;50&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;51&lt;tt&gt;
&lt;/tt&gt;52&lt;tt&gt;
&lt;/tt&gt;53&lt;tt&gt;
&lt;/tt&gt;54&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;55&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;anvil &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hammer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |app|&lt;tt&gt;
&lt;/tt&gt;  app.frame &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hammer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hammer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:maximize&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |frame|&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;c&quot;&gt;# Create Menu Bar&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    frame.menu_bar &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |menu_bar|&lt;tt&gt;
&lt;/tt&gt;      &lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;c&quot;&gt;# File Menu&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      menu_bar.menu &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&amp;amp;File&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |item|&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:new&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:open&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.separator&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:save&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.separator&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:preview&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:print&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.separator&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:close&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:quit&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;c&quot;&gt;# Edit Menu&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      menu_bar.menu &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&amp;amp;Edit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |item|&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:undo&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:redo&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.separator&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:cut&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:copy&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:paste&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:delete&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.separator&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:selectall&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.separator&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:preferences&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;c&quot;&gt;# Search Menu&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      menu_bar.menu &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&amp;amp;Search&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |item|&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:find&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:replace&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;c&quot;&gt;# Help Menu&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      menu_bar.menu &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&amp;amp;Help&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |item|&lt;tt&gt;
&lt;/tt&gt;        item.add(&lt;span class=&quot;sy&quot;&gt;:about&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    frame.text_control &lt;span class=&quot;sy&quot;&gt;:size&lt;/span&gt; =&amp;gt; { &lt;span class=&quot;sy&quot;&gt;:width&lt;/span&gt; =&amp;gt; &lt;span class=&quot;i&quot;&gt;100&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:height&lt;/span&gt; =&amp;gt; &lt;span class=&quot;i&quot;&gt;200&lt;/span&gt; }&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    frame.create_status_bar(&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;    frame.set_status_text(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hammer World!&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


The project is in need of talented and eager individuals to help it get off of its feet. If you are interested in contributing, &lt;a href=&quot;http://anvil.rubyforge.org&quot;&gt;check it out&lt;/a&gt;!
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>steve</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-11:5</id>
    <published>2007-08-11T02:45:00Z</published>
    <updated>2007-08-11T03:10:06Z</updated>
    <category term="noob"/>
    <link href="http://grasprubyonrails.com/2007/8/11/i-m-steve-and-i-m-a-noob-hi-steve" rel="alternate" type="text/html"/>
    <title>I'm Steve... and I'm a noob. [Hi, Steve]</title>
<content type="html">
            Alright, for anyone reading this blog to learn about Rails (hopefully, all of you), I'll just go ahead and give the spoiler. This particular post contains nothing specifically Rails related. I just wanted to precede all of my problems that you will no doubt be seeing on this site with the disclaimer that I am a certified noob.

I own a web design business (www.nobswebdesign.com), and have programmed everything to date in PHP and javascript with some AJAX sprinkled in. That is, until my most recent project. So, for the last 5 weeks, I've been learning this new language, and so far so good. Yes, there may be that occasional night where I spend 3 hours staring at an &quot;if&quot; statement that I can't get to work. But other than that, I'm nearly done with the project. That could never happen in any other language. I'm loving it. 

But be forewarned, you are likely to see some pretty obvious questions raised in my posts. Hopefully, they'll help someone.
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-10:4</id>
    <published>2007-08-10T18:11:00Z</published>
    <updated>2007-08-10T18:55:12Z</updated>
    <category term="bdd"/>
    <category term="rails"/>
    <category term="rspec"/>
    <category term="ruby"/>
    <link href="http://grasprubyonrails.com/2007/8/10/rspec-and-restful-polymorphic-url-helpers" rel="alternate" type="text/html"/>
    <title>RSpec and RESTful Polymorphic Url Helpers</title>
<content type="html">
            Going backwards with RSpec is a pain. By backwards I mean, write the specs after the specifications (my application) already exist. It feels like I'm re-writing all the code I just wrote. I can see the value in writing the specifications as we bring more team members on board and now my mindset is such that I feel like I'm writing documentation to support them as we introduce them to the code base. The real pain started to set in when I had this small problem.

The problem I'm having is that rspec is returning an error every time it encounters a method in the view that takes advantage of the polymorphic helpers AND does not pass the appropriate instance variables. Rails by default will allow you to call these methods without passing arguments to it. Here is the error:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;ActionView::TemplateError in 'Edit Artist Page should render the edit artist form'&lt;tt&gt;
&lt;/tt&gt;label_artist_url failed to generate from {:action=&lt;span class=&quot;er&quot;&gt;&amp;gt;&lt;/span&gt;&amp;quot;show&amp;quot;, :controller=&lt;span class=&quot;er&quot;&gt;&amp;gt;&lt;/span&gt;&amp;quot;artists&amp;quot;} - you may have ambiguous routes, or you may need to supply additional parameters for this route.  content_url has the following required parameters: [&amp;quot;labels&amp;quot;, :label_id, &amp;quot;artists&amp;quot;, :id] - are they all satisfied?&lt;tt&gt;
&lt;/tt&gt;On line #3 of app/views/artists/edit.rhtml&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    1: &lt;span class=&quot;ta&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Editing artist&lt;span class=&quot;ta&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    2: &lt;tt&gt;
&lt;/tt&gt;    3: &lt;span class=&quot;c&quot;&gt;&amp;lt;% form_tag label_artist_path, :method =&amp;gt; :put do %&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


By providing label_artist_path with its arguments this error goes away:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;label_artist_path(&lt;span class=&quot;iv&quot;&gt;@label&lt;/span&gt;, &lt;span class=&quot;iv&quot;&gt;@artist&lt;/span&gt;)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


This to me however adds unnecessary noise to the already easy clutter erb syntax and I would much rather just use this method without having to pass its arguments. There is also another option: stub out the label_artist_path method. My problem with this is that I feel like I'm not really testing my views fully and it will be hard to maintain considering I use these methods everywhere in my views. I could write a module that would include these methods, but this tends to be a big no-no in the rspec philosophy as you are hiding away some of the specifications. I'm thinking the best solution is to patch whatever the problem is in rspec, but I'm not sure where to start. I had a long discussion about this with &lt;a href=&quot;http://blog.davidchelimsky.net/&quot;&gt;David Chelimsky&lt;/a&gt; about this topic on the rspec mailing list and continued on the irc channel. I even posted a bug report on it &lt;a href=&quot;http://rubyforge.org/tracker/index.php?func=detail&amp;amp;aid=12963&amp;amp;group_id=797&amp;amp;atid=3149&quot;&gt;here&lt;/a&gt;. We were trying to pinpoint where in rails these instance variables get sent to the helpers. He made the suggestion of adding the following code into my before method:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;(&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;iv&quot;&gt;@controller&lt;/span&gt;; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;; &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;).send &lt;span class=&quot;sy&quot;&gt;:include&lt;/span&gt;, &lt;span class=&quot;co&quot;&gt;ActionView&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Helpers&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;UrlHelper&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


Which gives a completely different error:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;ActionView::TemplateError in 'Edit Artist Page should render the edit artist form'&lt;tt&gt;
&lt;/tt&gt;You have a nil object when you didn't expect it!&lt;tt&gt;
&lt;/tt&gt;The error occurred while evaluating nil.url_for&lt;tt&gt;
&lt;/tt&gt;On line #3 of app/views/artists/edit.rhtml&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    1: &lt;span class=&quot;ta&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Editing artist&lt;span class=&quot;ta&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    2: &lt;tt&gt;
&lt;/tt&gt;    3: &lt;span class=&quot;c&quot;&gt;&amp;lt;% form_tag label_artist_path, :method =&amp;gt; :put do %&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


For some reason the controller is not being set and that is basically where we left off. If anyone has any solutions, please comment! I will keep this post updated.
          </content>  </entry>
  <entry xml:base="http://grasprubyonrails.com/">
    <author>
      <name>lance</name>
    </author>
    <id>tag:grasprubyonrails.com,2007-08-10:2</id>
    <published>2007-08-10T02:25:00Z</published>
    <updated>2007-08-10T18:55:29Z</updated>
    <category term="rails"/>
    <category term="ruby"/>
    <link href="http://grasprubyonrails.com/2007/8/10/new-grasp-ruby-on-rails-blog" rel="alternate" type="text/html"/>
    <title>New Grasp Ruby on Rails blog!</title>
<content type="html">
            Finally the much anticipated (by those few lucky enough to have heard about it) Grasp Ruby on Rails blog has arrived! The goal of this blog is to be like every other good Ruby on Rails related blog: complain about some problem we encountered and then describe the steps we took to solve them. We're in the process of collecting anyone who is proficient in enough rails to contribute to this blog. If you are interested, comment!
          </content>  </entry>
</feed>
