Chris and I went to Ruby on Rails Camp in San Jose. I do not know the valley well (or at all really) and now that I have been there I will say that IBM’s Almaden Research Center is really spooky. It looks like you are arriving at a heavily guarded orchard until you drive to the main compound. About 31 floors down is where Chris says they keep the zombie making chemical warfare research facility.
Rails Camp turned out not to be held in a subterranean nightmare factory and was very pleasant. When sessions were being decided on in the morning, someone wanted to know about RJS. Since we had used RJS/related techniques a lot, I decided that I would give a talk about it. Little did they know that deep down, I do not know that RJS is all that good an idea.
So to improvise a presentation, I stole some slides from this fantastic presentation about Rails AJAX techniques by Thomas Fuchs. It has a really funny picture of a cow-pig-sheep-chicken thing so I would pretty much suggest it even just for that. Then I realized I didn’t want to show any actual Spongecell code to give my examples and so I scaffolded out a stupid little toy thing to use. I never use scaffolding/generators, but I suddenly appreciated the ability to pump out a cookie cutter toy for this sort of thing.
Anyway, I think those slides explain what RJS is pretty well, so I will just list my gripes, which I got to at the end of the presentation:
- Using RJS files is usually silly. You just end up with a big pile of tiny little files that do a couple mutations on some other page, they don’t make much sense by themselves.
- This can be overcome, but: what context are you executing in when your response gets eval’ed? What is the value of ‘this’? How do you figure out what on the page you are responding to? You can figure these things out, but it’s not well documented and much less straightforward than when you are dealing with event handling methods and callbacks on the page.
The best thing that I found out at RoR Camp is that Haml looks very worth using. I had some doubts because when I initially saw it, only this blog entry seemed to work and the main site was broken and I didn’t find answers to my questions about performance and how helpers worked with this system. Well according to John Green, the author of said blog entry, it is fast and helpers (and more importantly to me, helpers that take blocks) work like in erb. So in the interest of having really good looking HTML in our views and never forgetting to close a div again, I am all in favor.
Also of note is that it sounds like IBM lurves Ruby and Rails. Which is great! Rails needs the kind of corporate support only a vast army of eZombies can provide.