Well I am going to show you one way that it can be done. Of course we won't be creating a site as great as Instructables to start with, but the principles can easily grow into any type of site you can imagine with a bit more work.
Step 1: Don't Repeat Yourself
One of the main principles of Ruby is D.R.Y. so we are going to stick by this as much as possible.
Lets start by finding a fully functional framework.
Instant Rails is a great project. Click on the link and unzip the file to a directory that has no spaces (like C:\). Don't worry for a small file it takes a long time to unzip, this is because of the many small folders that it contains.
Step 2: Building a Comment Page
Now start InstantRails.exe
It will probally ask to update the configuration files. Select OK.
Step 3: A Little Background
Ruby on Rails works using a MVC structure. That is Model, View, and Controller.
The Model is the part that does all the work, it will be the number cruncher, the storage structure etc....
The View is just that a viewer. This is going to generally be the format that is presented to a web page in our demonstartion.
The Controller is the part that takes the user input and passes it on to the Model.
So you see the User enters text into the Controller, that is then passed to the Model where it does something and spits it back out to the View.
Simple enough, but keep it in mind as we go through the next few steps.
Step 4: Create the Application
Open a ruby window by using InstantRails-->I icon on top left-->Rails Applications-->Open Ruby Consolw Window
Step 5: Executing the First Commands
Step 6: Create the Controller
Navigate to the new directory: cd comment
Next type: ruby script/generate controller Comments
Step 7: Create the Post Model
This is nearly identical to the last one.
Type: ruby script/generate model Post
Step 8: Finnaly Some Real Ruby Stuff
Open the file 001_create_posts.rb
It should open with SciTE, if it does not you may want to use that for the rest of this demo.
Step 9: Add the Fields
Under the line that starts create_table insert
t.column :name, :string
t.column :comment, :text
Save file and close the SciTE.
Step 10: Where Is the Config
Go to the config folder and open the database.yml file with SciTE.
In the first section after the comments (the green text) you will see the development section, that is the database we will be using for the time being.
The name of our database should be comment_development
Step 11: Create the Database
You may have to unblock this at your firewall.
Next go to -->I icon-->Configure-->Database(via PhpMyAdmin)
Step 12: Creating the Database
Here it is : comment_development
Accpet the defaults and close the window.
At this time go ahead and shut down apache by the same method we started it but use the stop button this time instead.
Step 13: Start the Ruby Server
And we will start the server.
First Navigate to the comment directory by cd comment
Now input: ruby script/server
Step 14: Set Up the Controller
Go to -->app\controllers and open the comments_controller.rb file in SciTE
Step 15: Edit the Controller
right in the middle.
Step 16: Migrate the Db
This will prep the files and load them for viewing.