1. Setup the MySQL tools on your computer. Setup of MySQL tools was relatively easy, all that was needed was to download the tool from the MySQL site and run the default setup configuration install. Once install the application just needed to be launched.
2. Setup InstantRails and setup a new application directory for each of your web application projects.InstantRails was an easy setup as this has all the necessary components needed to run ruby on rails. However, there was an issue for myself and running WAMPServer on the same machine as this also installed all the necessary components such as MySQL, Apache which conflicted with InstantRails. So I made an executive decision and went with setting up ROR on WAMP, which proved to be a little difficult at first but runs fine now.3. Once Rails is running at http://localhost:3000, you need to configure database access. To start the internal webserver of WEBrick is pretty straightforward. What you needed to run is a command prompt from Windows and browse to the top directory of your newly created web application in Ruby. Once there you need to run this command to instantiate WEBrick 'ruby script/server'. This kicks of the local webserver running under a different port of the machine and serves various requests from that port (3000) which you can see below from the screen shots.
Going to http://localhost:3000/ in Firefox Web browser, shows this form which means the WEBrick webserver is operational and ruby is working correctly.
To configure the database(s) for the web project. Yes database(s) as this creates a set of similar database configurations (i.e. one being the development one, testing one, and production one). These are stored in the config/database.yml file. When setting up the project however an explicit command needs to be run when creating the project in Rails so that the database.yml is setup to connect to a real MySQL database locally and not the SQLlite db it normally creates in the database.yml. This command is exactly the same as the creating the ruby project however there is one extra option which defines to use MySQL instead of SQLLite. 'rails OTBS -d mysql' This will update the database.yml file accordingly, and all thats needed to be done to the file is update it if you have any special security logins for the databases. Below is a screen shot of the database.yml i created of the Online Taxi Booking System.
4. Generate the Passenger model by creating the MySQL database and 'passengers' table from the information above.
To generate the passenger model in rails you can use the command scaffolding to do this.
ruby script/generate scaffold Passenger name:string contact_number:string
suburb_origin:string street:string street_number:string building:string
suburb_destination:string passenger_number:string taxi_type:string
date:date time_required:integer
Once the model has been created you need to run the command 'rake db:create' from the command line which will create the database into MySQL.
After the database has been created you need to create the table based on the scaffold generation of passengers. To do this run this command 'rake db:migrate', which will create the passengers table and populate it with all the fields specified earlier in the scaffold command.