Sunday, July 19, 2009

Workshop 6/7: Login Headache

You may have read my rant on the developer forum about ROR giving me a headache. Well here is my expanation of my issue. I have followed the learningrails webcast series for developing web applications, and you may notice that the css that I have used in my OTBS comes straight from them. In webcast 10 and 11 they develop or introduce the sessions controller and include the AuthenticatedSystem. My problem arises from the fact that no matter what i seem to do the authentication controller seems to think I am logged in. Below is a screen shot of my application.html.erb file: Unless I have completely got it wrong, the "logged_in?" is not getting changed, and the session is staying live (so to speak), which really makes it impossible to test my application correctly. If the user is not logged in I dont want them to be able to book a cab. Unfortunately, I always seem to be logged in. So to reiterate what I said on the developer forum(on 8th July):
I am definitely starting to loath the whole Ruby on Rails experience. I have been endeavouring to get something as simple as sessions to work. I am either connected or not. Well that all sounds good. Except for the fact that I am connected when I shouldnt be. Following the learningrails screencasts, I add authentication to the application. I add the before_filter to all the relevant controllers. However when I logout, i stay logged in. AAAARRRRGGHHHH!!!!
The thing that has stood out for me with Ruby, that they said ad nauseum on the learningrails webcast series, developing with Ruby is MORE FUN. Well in my experience NOT is actually more the case. It is more infuriating than anything else I have ever had to program. When it works it is good. When it doesnt my only response is AAAARRRRGGHHHH!!!!

Workshop 7: End of the Line

To deploy an application to production, it must be production ready. Well in successful project world anyway. I have raised some issues in the forums about where we have gone with the OTBS and especially the failings that affected my development process.

My system is far from and never will reach a production ready stage. The reasons for this are many and include the following:

  • lack of source code control
  • lack of testing methodology
  • no interface/linkage for payment mechanisms
  • what is the process that happens after a taxi is booked?

One of the problems that we have endured as developers is lack of a project plan. Reviewing the Workshop material, these are issues that were to be addressed by the blue team in Workshop 5. I am not sure of their progress but they have failed from a project management perspective in that they have not managed user expectations on this project.

It is at moments such as now when upon reflection I feel that I maybe should have chosen the other route and joined the blue team. The questions that have been tormenting me over the last few weeks are exactly the questions posed by Ken for the Managers thread (ie the blue team), but due to time constraints there is no way that these can now be achieved.

But even going down that path we are still in the situation of not having a project manager to set the project on track and to bring it to a successful conclusion.

Maybe it is worth thinking about for future versions of this subject to involve the project management subjects in a combined assignment across subject boundaries?

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