Monday, April 28, 2008


Ok so I used scaffold and done a few tutorials before launching into my own project. I knew REST and CRUD and all that stuff were important but never really understood them. Im not saying I completely understand the concepts yet, but I am starting to realise their importance, especially after my project was getting messier and messier and when I started to think along these lines ... "This is rails, why the hell do I need to hack this controller to get it to do something simple" I turned to google to see what I was missing.

First blog I came across was this one which lead me to a series of blogs from softiesonrails which made things alot clearer.

Part 1 -

Part 2 -

Part 3 -

Part 4 -

Part 5 -

One of the main things I got out of these blogs was this paragraph from Part 4

You may already be wondering how in the world you're going to develop a Rails application if those are the only actions you're allowed to have in your controllers. Well, first of all, don't worry. If you really, really think you have a situation that requires a few extra actions, then go right ahead and add them to your controller. Just remember that having any extra actions can be a warning sign that you haven't identified all of your resources yet.

After trying to hack on extra actions to my controllers i finally realised that I was treating rails with contempt. It was trying to push me to use the REST and CRUD principals while I was trying make it work without really understanding what i was doing. I still wasn't thinking of my app in terms of resources.

The series mentioned above is invaluable for rails newbies like me that have a bit of an understanding but are still trying to use almost OO concepts to build websites.

No comments: