Jumping into Rails

July 4th, 2006 by Strawp

I’ve just picked up Rails after a course at OpenAdvantage (great course BTW, if your feedback form was on the web I would have filled it in guys, and you would have got “excellent” on all counts! Who uses paper feedback forms these days, honestly?!) Having been a PHP developer for about 5 years and having developed web apps in Coldfusion, .NET, Java, ASP and PERL in between I thought this needed a look in. From what I’d seen of Rails, my PHP development was getting incredibly close to what Rails was trying to acheive anyway.

It turns out Rails rocks, but it needs some tweaks to the default install. The problems I have with it at the moment is that although scaffolding is brilliant, the code it produces isn’t. Sure, it’s only supposed to be a “scaffold”, but why should you have to touch it at all? Isn’t Rails supposed to be DRY?

Turns out you can fairly easily create your own custom scaffold which will stop you having to go back and tweak things. I’m going to have a go now, and I’m going to try and “fix”:

– H2 at page start instead of H1s
– OLs for listing objects instead of tables
– Consistent whitespace usage
– Use of a “confirm” page for deleting objects instead of that horrid JS hack that creates a form to post on the fly and uses client validation
– More semantic form markup
– AJAX forms, without any JS on the page prior to onload

If it works I’ll zip up my scaffold and post it on here

Comments are closed.