Project 4.0: Articl.es

Jan 31, 2011

Objective

Gain familiarity with the Rails framework.

Build your first Rails application from a provided functional specification.

Prerequisites

You should have completed Project 3.

Requirements

You must implement a complete Rails application as dictated by the Functional Requirements below.

Grading criteria (1000 points)

You must provide seed data so when I run your application, some articles are present in the database (see the Unit 4 topics for a hint).

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

I must be able to run your migrations, insert your seed data, and run your Rails application.

This is due by 9AM on Monday, Feb 7.

Recommended Steps

Download this icon set, they will come in handy for this and all remaining projects.

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

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

Realize there are some efficient ways to set up your .gitignore file across your whole repository. However, these instructions are repeated per project in order to emphasize the process and workflow of creating a new Rails application in its own repository. While working on your application, be sure to commit often.

Next, create your application:

cd project04
rails .

And so on... the rest is up to you.

IMPORTANT: although you should never include sensitive information in your repository, I want you to include your database.yml file in your repo.

The purpose of this assignment is to see how well you can leverage the framework's features in creating an application on your own. Please come see me in person during office hours for assistance if you get stuck. Be sure to read the entire spec as some details have visual cues, other cues are in the text. If something is vague or you'd like to ask the CEO a question, post to Ore.

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

Premise

You're sweating. "Fifty million dollars?!" you think. "All for an application I can build in a day? This CEO must not know a thing about RAD frameworks."

"Well," says the Articl.es Inc. CEO, who sits across the table before you, "What do you think? Can you build this application? It's certain to make me rich. I've even got the trendy domain name. Cool, huh? Everyone will think I'm a genius." You nod your head in agreement, sitting there silent in disbelief, as the CEO slides a document across the table for you.

"Great, here's the specification. It's as good of a description of this application as I could come up with right now. Remember, I basically want this to take over the world. Although I'm not quite sure I understand everything it has to do, this should be close to a complete description."

Functional Requirements by Dudley Wilson, CEO

Articl.es is an application to take over the whole world. The first part of this takeover entails the ability to manage articles.

This application should allow anyone to create, edit and read an article. It should also list all of the articles in the system.

When a user first visits our domain, the list should be displayed:

If more than ten articles are listed, the list shouldn't grow in length -- it should scroll so the whole browser window doesn't scroll. My sister asked for that feature, I think it's a good idea. She also says that when you click on the delete icon (by the way, my brother says to use colorful icons) the application should warn you before deleting. Isn't that smart? There should be buttons to view and edit an article.

If you view an article you should see something like this:

See how the subtitle changed? Isn't that neat! This page should render the article text in a nice fashion. Not too fancy, but there should be spaces between paragraphs. Oh, and be sure to display the number of times the article has been edited, and the date it was created. The buttons should work in an obvious fashion. Note that the email button should result in the user's email client opening up with a subject matching the article's title, and the body should contain a link to the article.

If you click on edit you should see:

My cousin thought it would be cool if, after you hit "save" or "back," the application would take you to the last page you were on. I told him that wasn't possible since you could reach the edit screen from either the list or the article itself, but he says he saw it in a movie once. So it must be possible, right?

Of course, the user should be able to create an article, too:

This screen should report errors if any of the article details are blank. Also, I don't want any articles by authors with the name "Sally." My first girlfriend in second grade has the name Sally and it still bothers me to this day, so no authors with the name Sally should be allowed.

Hints

See the links and topics in Unit 4.