Saturday, April 7, 2007

Customizing Rails and rabbit holes

Some things are easy in Rails... others are definitely not!

I mentioned in an earlier post that I'm using AjaxScaffold for the UI... I like the looks, there is lots of functionality, a fairly active forum, and the author (Richard White) has been very helpful. It's a great plugin.

With all that said, it's still been a challenge to get everything working that I wanted. The problem as I see it is "documentation": too much of it and not enough of it. This makes improving your expertise in Rails quite a challenge and will, IMO, keep nubies nubies for longer than I would like. Here's what I mean.

On the surface, AjaxScaffold (AS) has a great deal of very good documentation. There is, for starters, the website mentioned above. Then there's Richard White's home site, where there are a number of excellent articles describing AS. There's also Scott Rutherford's blog at Scott clearly knows AS well and also does an excellent job of writing about AS. Finally, there's the Google Groups AS forum, with many fine developers working on, describing, and customizing AS.

On the surface, you would think that customizing AS would be a piece of cake: just search the places mentioned above, get the relevant posts, and you're off to the races. Well, it doesn't work that way... at least for nubies. And that's a shame because it just makes getting productive in Rails that much more difficult.

Here's why the current approach doesn't work well.

1. There is no single place where someone can go to learn about AS -- either for an overview or for all the details. Things are scattered all over the place. That's not to say that there aren't some great tutorials; but usually those tutorials deal with only the most basic of information. This is like many of the gee-whiz Rails videos that I've seen: you learn how to do the simplest of tasks (which are admittedly much easier than without Rails), but you don't learn how to get to the next level. The first step is easy but watch out for the next step... it's a doozy.

2. Good information coexists with not-so-good information. As a nuby, you can't always tell the difference, and you can go down rabbit holes a bit too easily. Like Alice, it takes a long time to find your way back.

3. Good information is incomplete. This is the "Curse of Knowledge" in action (see the book "Made to Stick" by Heath & Heath... awesome!). I found good suggestions in a couple of different places, with code samples no less, but the surrounding "..." (meaning fill in the blanks here) turned out to be the key information that I was missing.

4. Information is out of date. Rails is changing and changing fast. So are the supporting tools, such as AS. On the one hand, that's really great. It's always nice to see new features being added. On the other hand, it's hard to keep up with all those changes. At some point, you may have to decide to give up on new features for some stability in your own development environment. For example, AS first appeared as a generator and then it migrated to a plugin. That's great, but how do you separate comments about the generator from comments about the plugin: it's not always clear which is which. Another rabbit hole to get lost in.

5. New stuff gets added that you aren't using. Now there's a new upgrade called ActiveScaffold. It has a lot of great new features and I'm sure that it's even better than the old AjaxScaffold. It has a few features that I would like to have, but -- as a nuby -- I'm a little too slow at learning this stuff to just jump on the new bandwagon. So now there are comments about ActiveScaffold that can send me down more rabbit holes. Fortunately, Richard gave this a new name and a new website, but it could (and was originally) referred to as version 4 of AS. Were that the case, I'd be in even more trouble.

So what's the problem here? It's that there's no one place to go to where you can learn "all" about AS... and I'm getting the impression that this is not just an AS problem. I'd really like to see one place where there is solid, up-to-date documentation about the package and all the options, along with examples.

I keep wishing for something like Perl's CPAN, the central repository where all (or at least most) contributed Perl modules reside, and where complete documentation is supposed to (and usually does) live.

So how am I doing with the customizations I want? I am making progress... I spent several hours digging through the code (amazing stuff, that AjaxScaffold) and I finally have the create/edit form displaying the drop-down box as desired.

I still don't have it saving the information properly, but I'm sure that's "just a little more" code-digging, rabbit-holing time to resolve and then I'll have this piece of the application up and running.

BTW, if you're interested in the solution to my AS quest, I'm documenting it as I go in the forum, under the title: Getting a drop-down to work in the create/edit form.

No comments:

Post a Comment