Saturday, March 17, 2007

Assets, assets.... or is it asset?

Well, I got AjaxScaffold to display at least the first page... nice. However, whenever I click on "Edit" or "Create New", the spinner comes on and nothing happens. This is the kind of thing that's been happening for the past couple of days: makes no sense to me. Anyway, I happen run across a page on the Rails wiki [] that reminds me about the whole pluralization, capitalization, CamelCase convention "thing" and I decide to check this out one more time: I see a problem: I've got an "AssetsController", not an "AssetController"! (Never mind that I made that change a while back in the streamlined days to get something working... I'll go with convention).

I make the changes and there's definitely some progress: My Edit and Create New links now work, but all the formatting has been lost - it's now just a plain jane page. Looks like the CSS has been lost in the changes (or should that be 'change'?).

I restart mongrel, but that doesn't fix it... two steps forward, one step back.

What I (re)learned today:

1. Some conventions take time and effort to learn. No matter how "neat" or logical it seems, the conventions on tables, models, and controllers is NOT completely -- or even partially -- intuitive: my fingers and brain just do not automatically get things right. And sometimes things seem to work but really don't and they're a result of all this switching back-and-forth that Rails does automagically for me. To borrow from the author of TipSheetForBeginners said: "Things I ... have to look up every ten seconds" aren't all that productive.
2. Rebooting servers is more important than you might believe. The buzz is that Rails development environments are neat because everything is automatically re-loaded for you so it's easy to test. Well, it ain't necessarily so, as I've learned through much trial and error. Some things require that you reboot mongrel. I know now that changing plugins requires this (not documented anywhere that I can readily find) because there's some initialization required for the plugins. I've also found under other circumstances that a reboot seems to clear things up... for no apparent (to me) reason.

Note to self: Carefully crafted screencasts may look good, but there's always something that you're not seeing.

No comments:

Post a Comment