Friday, September 12, 2008

Ruby on rails - Project progress

Online Taxi Booking System

Environment
  • System - Dell Inspiron I1720, Intel Core 2 duo 2.00 GHz, 2GB RAM
  • Windows - Vista Home Premium

Software for this project
  • Ruby on rails - Instant Rails 2.0
  • Database - SQLite 3
  • Editor - Textpad

Progress

1 - Start Instant rails application, just run the executable.
Image of instantrails.exe


2) From the rails application window, open a rails console window



3) Run the rails command to create a new application. Created a new application called taxibooking.
  • rails taxibooking



4) Windows representation of the directory structure created



5) Start the application using the default instant rails web server, Mongrel to see
things are working up to this point



6) Type taxibooking application web address,
  • http://localhost:3000/


6.1) The server can be stopped at this stage or once more work as been completed
it can be restarted.


7) Navigate to DB folder within the application, define the database name parameters
for SQLite3, this is only required if you want to change the default name provided by
SQLite3.



8) Run the ruby generate migration command to generate the database migration.
This will create a ruby file in directory migrate.
  • ruby script/generate migration AddPassengersTable



9) Edit the migration file and define the passengers table structure.
(I have defined the table structure as per workshop 3 for ITC382 subject)



10) Run command to generate the table
  • rake db:migrate


10.1) Enter data to the table via SQLite3,



11) Run command to generate controller
  • ruby script/generate controller Passengers



12) Create an index.html file to be displayed when the passengers action is requested




13) Started Mongrel server again. If the server was not stopped earlier, stop and start is required at this point.


14) Type taxibooking application web address
  • http://localhost:3000/passengers


Success! list of bookings in the database is shown

No comments: