Project 2.0: Depot Application

Jan 17, 2011

Objective

Establish your Rails development environment.

Create your first Rails application.

Prerequisites

You should have completed Project 1.1.

Requirements

Using Agile Web Development with Rails chapters 1 - 6 as a guide, get a basic Rails application up and running.

Recommended Steps

In your repository, create a directory called project02. Inside that directory, create a file called .gitignore. Edit .gitignore so that it contains the following:

log/*.log
tmp/*
tmp/**/*
db/*.sqlite3

Screencast about git and Rails.

IMPORTANT: although you should never include sensitive information in your repository, for this class, I want you to include your database.yml file in your repo. In other words, don't ignore database.yml via .gitignore.

The purpose of this assignment is to begin our journey with Rails. The first step is to complete the Depot application used in Part I of Agile Web Development with Rails.

The first thing you need to do is to set up your development environment. Most Rails developers use Linux/OSX, but Windows is fine. I will leave the task of setting up your environment to you (see the first few chapters of the book). Please, please come see me in person during office hours for assistance if you get stuck.

IMPORTANT: we're using Rails 2.3.10 for this class, and sqlite3. (sudo gem install rails -v2.3.10). Ideally, use Ruby 1.8.7 (but Ruby 1.9.2 is ok). If ruby was already installed on your system, check its version (ruby -v) and update gem (sudo gem update --system).

Once your environment is set up, you should be able to follow the tutorial without any problems. You are free to use Passenger/mod_rails instead of Mongrel. If you get done with chapters 1 - 6, feel free to work ahead and complete all chapters of Part I and finish the depot application (next week's project).

IMPORTANT: when initially creating your rails app, you should first change to your project02 directory and then execute rails . ("rails dot" not rails depot as the tutorial states).

Good luck! I can hardly wait to see your implementations!

Example Workflow

Say you're ready to begin the application.

cd project02
rails .
touch log/.gitignore
touch tmp/.gitignore
git add *
git commit -m "Initial commit. Yeah!"
git push

For the most part, you'll always start a new Rails application just like that. While working on your application, be sure to commit often.

git add app/models/zombie.rb
git commit -m "Adding the zombie class. Mmm brains!"

Always, always always commit once you've finished a unit of work (eg, like adding the menubar) and always, always, always write meaningful commit messages.

When you're doing with this project, or need to share the code, git push.

Grading criteria (500 points)

I must be able to pull your repository and see your project02 directory contains your app root. (eg, project02/app, project02/config, etc)

I must be able to run your migrations, seed data (if present/necessary), and run your Rails application.

This is due by 9AM on Monday, January 24.