rails generate scaffold NAME [field[:type][:index] field[:type][:index]] [options] (generate the whole shootin’ match: model, database migration for that model, controller to manipulate it, views to view and manipulate the data, and a test suite for each of the above)rails generate migration add_column_to_table column:string (add a column, in this case a variable named column that is a string, to an existing database table; many other variables may be added and used to reduce the rewrite before performing a “rake db:migrate” in terminal to actually alter the database)rails generate controller section_name index (add a controller; same as above with variables)

It you haven’t been playing along a home, you might want to start now. It’s easy and cheap-free on the micro instance. In the words of E2C for Poets, this is what it is all about:

There’s this great service called EC2 run by Amazon, the same Amazon you can buy books and refrigerators from.

EC2 allows you to create your own server in Amazon’s server farm located somewhere “up there” in the clouds. It could be in Montana or New Jersey or Europe. You don’t have to know or care where the server is.

You also don’t have to talk to anyone to create a server. And when you’re done with it, just shut it off. You only pay for what you use. And it doesn’t cost very much. If you run a server for 8 hours it costs about $1. Update: For some people it’s free for a year!

If you’ve ever purchased anything at Amazon, you’re all set. And if you haven’t, all you need is a credit card.

I think any reasonably knowledgeable user could set up a server this way. You might have to scratch your head, or read the instructions two or three times to get past the hardest parts. But you don’t have to be an math major to pull it off.

You’re Done. What Now?

Horray! You are set up! What to do now? If you have an application you have written, I suggest you serve it. If you are just playing along at home for fun, I recommend the e2c.forpoets.org tutorial using the Hello World app. Part of the tutorial is shown below:

1. In the left margin of the dashboard, click on the AMIs link. You should see a popup menu in the upper left corner of the panel. Choose Public Images from the popup. It might take a few seconds for the list to appear (there are a lot of public images).

2. Type ec2ForPoets28 in the little search box near the top of the screen. A single item should show up in the list. Click on the checkbox next to its name.

7. Click Continue to get to the next dialog. You can accept the defaults. Click Continue.

8. This is where you give your instance a name. It’s like naming a cat. Pick something fun and memorable. (I named mine Einstein.)

9. Click Continue to get to the next dialog, where you choose the Key Pair. Click the radio button next to Choose from your existing Key Pairs, and then choose the one you created earlier in the popup menu. (We called our example Tahoe.)

10. Click Continue to get to the next dialog. Click the radio button next to Choose one or more of your existing Security Groups, and then select the default Security Group.

11. The final dialog in the sequence appears, summarizing the choices you made. If everything looks okay, click the Launch button at the bottom of the dialog. Pause for a moment to consider your accomplishment. You are now a Cloud Computing Expert.

12. In the left margin of the dashboard, click Instances. You should see a single entry whose status is “starting.” We’re now waiting for it to change to “running.” This could take as much as 10 or 15 minutes, depending on how busy the angels and elves at Amazon are.

Notes…

Later if you want to go “shopping” for other AMIs, Amazon maintains a directory that’s a bit like shopping for iPods or books, of popular AMIs. Too bad they don’t offer the same reviewing options as they do for consumer products. (Consider this a feature request.)

In putting together the sample server for this tutorial, I started with Amazon’s Basic Microsoft Windows Server 2003AMI with none of the frills.

Wait as much as 15 or 20 minutes for the status of the server in the Instances panel to change from “starting” to “running.” Now we just have to kick it in the butt to get the server software launched. You do that by logging in the first time.

1. First, locate the Key-Pair file (mine is called Tahoe), open it with a text editor (Notepad on Windows, TextEdit on the Mac). Select-All. Copy. Close the file.

3. Right-click on the instance you just launched. A popup menu appears. From the menu, choose Get Windows Password.

4. A big dialog appears explaining what it means to decrypt your password. Click in the “Private Key” box and paste the text you copied in Step 1. Click the Decrypt Password button. It takes a few seconds, then…

5. A dialog appears with the server password. Leave it open so you can refer to it in the next steps. (If you know how, you might want to take a screen shot of this dialog.)

6a. Launch the Remote Desktop Connection app from the previous section. Copy the address of the computer to the clipboard (in my screen shot it’s ec2-72-44-33-187.compute-1.amazonaws.com). Paste it into the dialog that opens in the RDC app. Click on the wedge next to the word Options in the RDC window. Where it calls for the User name, enter Administrator. Then Copy the Decrypted Password from the dashboard, and paste it into the Password part of the RDC app. Click the big Connect button in the lower-right corner of the RDC window.

6b. If you’re using CoRD on a Mac, instead of Remote Desktop Connection, the process is slightly different. In the lower left corner of the app window you’ll see a wedge, the letter i and a big plus sign. Click on the plus sign. A dialog appears. Enter a name for the server, I like to name mine after football players or soft drinks, but you could just call it My First EC2 Server. Then enter the address as in step 6a. The username is Administrator, and the password comes from step 5. Click the Save password checkbox so you don’t have to enter the password every time you connect. Below that, you can determine the size of the display, and some very nice advanced options that you can worry about later (accept the defaults for now). Close the Inspector and double-click on the name of the server in the left margin of the big window.

7. If all goes well, you should see your server running in a window on your desktop. But don’t be fooled, this virtual computer exists in the cloud, not here or where you are. It’s somewhere “up there.”

8. Three apps are visible: Firefox, the OPML Editor and the Windows Task Manager. OPML is, in addition to be an outliner, a web server. In the next section we’ll access this server in a web browser on your desktop machine. You can close the RDC window, or leave it open, if you want to explore. It’s just a Windows machine.

4. Open a web browser, paste into the address bar and press Return. You should see a sign-in screen that asks for a username and password. The username part is easy, it’s admin. The password is easy too. It’s the one you found in the previous section, from the adminPassword.txt file.

5. Once you enter the username and password you should see a screen that looks something like this.

At the beginning of the tutorial I promised you would see the Hello World app running on your new server.

1. Add “helloWorld” at the end of the URL in the previous example and press Return.

2. You should see Hello World, today’s date, the time, the IP address of the server, and a counter that starts at 0, and increments every time you refresh the page, which you should do a few times to prove that it’s a dynamic page.

I know it sounded more exciting a few minutes ago. Because now you’re a server dude or dudess, and this kind of stuff doesn’t impress us really.

3. Right-click it, and choose Stop from the popup menu. This causes the server to go to sleep, it’s as if you closed the lid on a Windows laptop. You can turn it back on by choosing Start from the same menu. Both these operations are quite quick, they take a few seconds each.

4. If you know you never want to run this instance again, choose Terminate from the popup menu. This shuts down the server, and throws away the instance permanently. It’s like taking your PC out to the garbage dump and driving away.

5. If you restart the instance, it will have a different address. When you access the server from your Remote Desktop client, you will have to change its configuration so that it knows about the new address.