Showing posts with label Observations. Show all posts
Showing posts with label Observations. Show all posts

Monday, July 6, 2009

Workshop 5/6: More Taxi booking system - followup

Must give thanks to Karen's comment. Even though what she said to do was what I had done, the fact that she commented actually triggered the correct outcome for me.

I have got the BookCab form integrated with my OTBS. In order to do this I had to do the following

  1. Move the bookcab method into the VehicleController
  2. Move the bookcab.html.erb file into the views\vehicle\ directory
  3. Change the form action to form_action ="cabtype" instead of "vehicle/cabtype"
  4. modify my application.html.erb file so that the 'Book Cab' link pointed to the correct controller and action.

On the face of it it looks like the variable scope is confined to the MVC that is of interest. In this case it was the cab booking variables in the bookcab view being transferred to the cabtype view.

My next step now is to introduce a login mechanism and enable passenger information to be collected.

Sunday, July 5, 2009

Workshop 5/6: More Taxi booking system

I have just been having a lot of fun.

I thought I would go back into the Taxi Booking system, to improve the look of the site and to look at adding login functionality. This would involve utilising what we had developed in workshop 4 with the changes in workshop 5.

I also wanted to change how I had dealt with the protect_from_forgery error that we all got in workshop 5. I simply hashed out the line, and so everything worked.

Well the idea started out as a good one. Unfortunately, I managed to break everything, so that nothing worked. I changed the routes file so that there were no recognised routes.

Scratching my head for half an hour ensued, until I realised that I had in actual fact hashed out all the route info in the routing file. So message actually made sense. With that sorted out and the taxi details showing again I decided to press on.

My Online Taxi Booking System now looks like

Unfortunately the information doesn't came across as you can see by the following:

I am beating my head against a brick wall at the moment. Possibly mind gone blank syndrome. I definitely need to get back to RailsSpace, for another installment, which might clear things up a bit. In the meantime, I close this blog post with a screenshot of my pages_controller and file structure

You may notice that the Vehicle Controller is empty. I was getting some routing issues and so just moved the code into the pages controller. I am definitely thinking this was the wrong way to go. But that is where it is at the moment.

Update

Well after posting this blog, I had a slight rethink and put the Cabtype method back into the vehicle controller. The views all seem to work, and the cabtype view does get displayed after submitting the booking form. Alas the variables are not being initialised, so the cabtype view is not displaying the selected information. Any ideas anyone?

Wednesday, July 1, 2009

CSS and Ruby

I have just come across this Ruby gem which could be very useful for you all.
http://lesscss.org/
Less is Leaner css. Less extends css by adding: variables, mixins, operations and nested rules.
If you use css then this could be useful.

Tuesday, June 30, 2009

Web 2 communities in action

Mythbuster Adam Savage fights $11,000 AT&T bill with Twitter army Have a look at the following commentry on Computerworld blog: http://blogs.computerworld.com/mythbuster_adam_savage_fights_11_000_at_t_bill_with_twitter_army?source=CTWNLE_nlt_dailyam_2009-06-29

Monday, June 29, 2009

Some very helpful Ruby tomes

I have just going through Workshop 6 and the Topic reading: (Hartl)

This made mention of David Hannermeir Hansens 15 minute blog development presentation. http://media.rubyonrails.org/video/rails_take2_with_sound.mov in the introduction. I watched this (i suspect that Craig had recommended this earlier) and wish that I had seen this earlier in the subject.

Having watched the demonstration, I read (Collingbourne)

I now feel that I have a much better grasp of ROR, because of these references. I have gotten back into the first few chapters of (Hartl) and really wish that this had been recommended prior to Workshop 1. It goes through a nice seemingly simple step by step process for setting up rails, and actually specifies requirements. There is a distinct chance that maybe hindsight is playing a part in my thinking, remembering back to the number of lost hours trying to get a working setup.

However, what really got me to put this missive together was a single line in (Hartl, s2.2.1)

In case you ever need to undo the work done by generate, you can use ruby script/destroy controller . That's certainly a lot easier than deleting a bunch of files by hand.
which clarified in my mind where I had been going wrong in my attempts at building the OTBS. i may well have seen this before, but I don't remember seeing this in the same section as talking about generating the controller. But then again, this may well be hindsight in action.


References
Collingbourne, H (2008)"The Little Book of Ruby"
Hartl, M & Prochazka, A, (2008). RailsSpace: Building a Social Networking Website with Ruby on Rails, Pearson Education

Friday, June 26, 2009

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.

Workshop 4: Puzzled

Have been going through the exercises for workshop 4 and am a little puzzled as to what is supposed to be happening with the adding values to the list. I get the list returned and nothing seems to have happened. (I think I just had an epiphany as I was writing this sentence.) It dawned on me that you need to specify the variable that you want to see. So you will see in the Image below that I have specified the value and got the expected result.


So the title above neesd to be changed to no longer puzzled.

I have looked at the challenge problems, and reviewed the code that Ken supplied. The exercises are relatively trivial and dont really provide much in the way of learning about Business Applications Development. Consequently I will not be spending time coding them.

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: 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) ======================================

Thursday, June 11, 2009

Exercise 10: Posting shenanigans

I just don't understand blogger sometimes. I had published the blog (Answers 1-6) and the tables were all over the shop. I have just done a cut and paste of the same code, and republished. Amazingly the result looks like it was supposed to. There could be something in that I used Windows live writer in this instance to re-publish, whereas I used blogger to post originally. Unfortunately, if you had been following my blog, then you would have known that i experienced the exact opposite scenario earlier on in the journey. Those blogs (Karen posted comments) may no longer exist, as it was very much a learning curve in the early days, and reorganisation of the material was in order.

Thursday, June 4, 2009

Newcastle Coders Group monthly meeting

I attended the latest monthly meeting of the Newcastle Coders Group last night (3 June 2009). On the agenda were talks discussing making application interfaces cool and using Ruby. The third item on the agenda was cancelled till next month. 'Cool’ Interface design with Luke Drumm Luke discussed the dynamics of a games engine and how it keeps a users interest by setting little tasks. Succesful completion of a task leads to the learning of skills which can be applied in future situations. This incremental skill level increase keeps the user happy and wanting to come back for more. The games paradigm is all about incentivising the user Luke compared the games interface mentality with the traditional business application approach which generally comes in one of 2 camps. Either the user is exposed to all the possible functionality and gets swamped with possibility, or the user has little exposure to functionality and at the same time is not shown how to progress. In either circumstance 95% of users use only 5% of an applications functionality. The main point that Luke put forward was that games designers treat the users like adults, with some intelligence, whereas business application designers treat users like children who need there hands to be held. (Please note that this conclusion came out in the discussion but has not been portaryed all that well in my discussion) Web Ready with Ruby with William Mason William gave a presentation about the ease of developing a website using Ruby. He was using the Ramaze framework. He built a basic food menu application and showed 4 iterations of the design. The adage that anything that can go wrong will go wrong in a presentation was very true. But he persevered and game a very quick overview of the design process. William used Netbeans as his IDE. Some useful (maybe) links that he gave are:

The thing that tied the 2 talks together for me is related to my experience with setting up a rails development environment. Luke says that people want to be treated like adults, which from his talk is based upon the premise that the user wants to investigate things for himself. There are times however when its good to be a child and being led by the hand is appreciated.

Wednesday, June 3, 2009

Microsofts New Search Engine

I have just used Microsoft's new search engine Bing and found it to be very useful. The little pop ups that appear next to the results, show additional information about the site. I used the search term "rapid evolutionary prototype webpages" and compared the results to google. The bing result returned more relevant answers to what I was wanting. Overall very impressed from first impressions.

Monday, June 1, 2009

Observations: Topic 4

The Study guide (p28) says "[See Figure 2-4 on Web server-enabling technologies in Conallen, p.23]"

The Resources section of the Subject outline only has Conallen listed as a recommended resource. Whilst nice to have it isnt a requirement. As a result I dont have a copy.

This makes viewing this particular reference difficult. I am not sure if there are many more direct references in the study guide for this text, but if not then it would seem a little harsh to not just provide the diagram in the Study Guide.