Showing posts with label Workshop 3. Show all posts
Showing posts with label Workshop 3. Show all posts

Thursday, June 18, 2009

Workshop 3: Follow Up

I persevered with my OTBS application today, and got the style sheets incorporated into the application. So it now looks nice. Am using the same style sheets as the LearningWebApps screen casts did.

Unfortunately I have just hibernated my Virtual Machine and it takes to long to bring back up, so no pictures of the current version for now.

I was reading Workshops 5-8 this morning and got a little concerned that the flow of the workshops doesn't seem quite right. Workshops 1-4 have been about setting up the ruby environment and having it talk to MySQL. Workshop 3 had us build the model using the scaffold which effectively built a working model (minus the niceties). Workshop 5 then seems to go back to the beginning and holds your hand as you build the application. It seems like it would have been beneficial to read all 8 workshops before starting so that we didn't bumble our way through setting up an application.

Wednesday, June 17, 2009

Workshop 3: Link issues

Just going through the workshop document again and decided I would try to look at the screencast for migrating a prototype to a production site. Unfortunately the link to http://www.mysql.com/products/tools/migration-toolkit/tutorials/migrate-sql-server.html gets redirected to http://dev.mysql.com/downloads/gui-tools/5.0.html which although probably very useful, not what I wanted to see.

Tuesday, June 16, 2009

Workshop 3: Building the model

The model has been built. Very ugly and definitely needs revision. But its a start.

This took a few iterations to get it to work. I started out with only a few fields in my model. Fell into a hole when, after having got that to work, I tried to add the remaining fields.

Still to do with this:

  • add look up values for passenger count, taxi-type, and building
  • get the site to look nice
  • lots more little things

Workshop 3: Much rejoicing

There is much rejoicing happening because I have just gotten MySQL to play nice with ruby.

I had been getting authentication issues, which resolved themselves by explicitly stating the localhost IP address (127.0.0.1) instead of using localhost in the database.yaml.

Additionally I had been getting the following error when trying to run the migration (rake db:migrate)

rake aborted! undefined method `each' for #

It turns out that MySQL 5.1 doesn't play nicely with Ruby and so the solution is to download an older copy of the MySQL client library. This link Aptana forum solved the problem.

So I now get:

>rake db:migrate
rake db:migrate
(in C:/Documents and Settings/Grant/My Documents/Aptana Studio/OnlineTaxiBookingScheme)
== CreatePassengers: migrating ===============================================
-- create_table(:passengers)
-> 0.0300s
== CreatePassengers: migrated (0.0300s) ======================================

Sunday, May 17, 2009

Workshop 3: Online Taxi Booking System: MySQL and Database design

Topic objectives

  1. Develop a database object design for an online taxi booking system (OTBS);
  2. Revise database techniques with Rails and SQL
  3. Describe how to use the MVC “push-based architecture” in the Ruby on Rails development environment

To do:

1. Set up the MySQL tools on your computer as described in section 6 above.

2. Rails will setup a new application directory for each of your Web application projects. Get InstantRails (Windows) or Locomotive (MacOS) running on your machine. Both packages install Ruby, Rails, a Web server or one called ‘Mongrel’ or another small Ruby Web server called ‘WEBrick’, and MySQL “inside a bubble” as I call it so that others parts of your system are not modified (Similarly ZOPE does with installing its own Web server and Python versions).

3. Once Rails is running you at http://localhost:3000, you need to configure database access. Connection to the database is specified in the config/database.yml file.

4. Generate the Passenger model by creating the MySQL database and ‘passengers’ table from the information above.

5. Further work on understanding MySQL under Rails by David Mertz:

a. See “Fast-track your Web apps with Ruby on Rails” at http://www-128.ibm.com/developerworks/linux/library/l-rubyrails/

b. The “Rolling with Ruby on Rails” series and “Cookbook recipes by Curt Hibbs and others beginning at http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html