This tutorial shows how to "scaffold" very basic forms in rails.

Create a folder that will hold your web site, I created a folder called "Sites" within my home directory.

Press apple key then space bar to start up spot light Start typing "Terminal", once it has been found you can click to run

spot light

Within Terminal Type

cd sites
rails inform
cd inform

Directory will be changed to 'sites'. A new rails application folder named 'inform' will be created, copying all required files into place. Directory will be changed to 'inform'.

The next step is to 'scaffold' 'notice': (when using 'scaffold' do not use plurals)

./script/generate scaffold notice title:string content:string userid:string

This will generate all the files and code required to view, edit and delete notices.

Now that all the files and code are in place the database needs to be created, by default ruby will use a flat db file for testing.

Within Terminal type:

rake db:create
rake db:migrate

This will create the database and the notices table. 'script/server' will start up the local web service.

Open a browser window and type:


This is the index page:

notices index


notices index


notices index


notices index

Index after Item added:

notices index

Press 'crtl & c' within terminal to stop web service.