DRYing up Views 2
Unfortunately, I missed my first tutorial at RailsConf today due to air travel nightmares. However, I was able to make it to a presentation by Bruce Williams and Marcel Molina, Jr. entitled “When V is for Vexing: Patterns to DRY Up Your Views”.
A few points I took away from this:
- It really IS possible to create views that are quite readable: even by designers, not developers.
- Block helpers are where it’s at. You can do much of the same stuff with block helpers that you can do with partials:
- Block helpers read better then a bunch of if statements or other conditional logic.
- You can use parameters (just like you would use local variables) except with helper methods you can properly document them.
- You can wrap stuff around some variable content. Such as:
fancy_box_with_borders do
<p>Stuff inside box.</p>
endThis talk also lit a fire under me to start checkout out templating language alternatives to ERB. I downloaded haml and started converting some of my Find Mini Golf version 2.0 templates over to it. So far, I really like it. It takes some getting used to but seems very readable and much more concise.
I’m not sure if it would go over well with outside designers we often have to work with. If we can get them to be dedicated to learning the Rails Way to do stuff, I think they will definitely appreciate the simplicity of things like haml. But I think it might be difficult to convince some designers to put the extra effort in to learning.
Airlines suck
It’s difficult to blog about RailsConf when one is stuck in a city hundreds of miles away…
Hopefully I’ll get there for at least the second tutorial session tomorrow. It’s a shame, because I was really looking forward to the tutorial about test driven development.
Guess I will just have to spend my hours sitting at O’Hare by reading about TDD.
Blogging RailsConf 2
Let the RailsConf blog begin!
Although I haven’t yet made it out of the airport in Philadelphia, and I’m not sure I ever will with the storm clouds looming over south Philly, I wanted to get the blogging started.
First observation:
There are a lot of people that have MacBook’s around me. Either there are a bunch of other people hopping flights out to RailsConf right now (seems unlikely) or Apple has really gained marketshare (quite possible).
I see several businessy looking people, an older gentleman, and more than a handful of hipster designer-looking types.
Is Apple gaining more ground than I realized? Or is this just another case of that phenomenon where once you are exposed to something, you see it everywhere? Maybe I just never looked for MacBooks before a week ago when I joined the Mac Club?
Goodbye Windows; Hello OS X 5
I finally bit the bullet and began the switch to Mac. Good job, Apple. All those silly commercials worked and I am now the proud owner of a 15” MacBook Pro.
Actually, it’s mostly due to:
- Parallels
At a couple of PhillyonRails meetings, I’d seen folks running Windows applications side-by-side with OS X apps. This was a huge selling point, as there a number of applications I have, and absolutely need, that don’t have OS X versions.
- Free BSD
Becoming more comfortable with Linux, I found myself lured by OS X’s familiar command line capabilities. Finally, I can forgetdirand just usels.
- Everybody’s doing it
It seems like all the good Rails shops use Mac. Damn peer pressure.
- Out with the old
The straw that broke the camel’s proverbial back was the touchpad on my Dell basically ceasing to work Friday night. Rather then try and fix it, or to order up a new Dell, I figured it was time.
Only a few frustrations so far:
- The dude at the Apple store told me that I had to get a MacBook Pro if I wanted to have dual display. So $2,000 later, I find out that’s completely false.
- I wish that the OpenOffice.org Cocoa version was finished. I’m using the X11 version right now and it seems fine, just not as pretty or as tightly integrated as a Cocoa version.
- The normal, time-intensive process of moving all of one’s personal digital life from one machine to another.
So I think now I am officially ready for RailsConf!
RailsConf sessions 1
Next week, I’ll be attending RailsConf and I’m pretty damn excited.
Dr. Nic recently released a neat tool called MyConfPlan.
It’s a little app that allows one to specify and publish which sessions at a conference they are attending. And so, I give you my RailsConf 2007 picks v1.0.
For the benefit of our other team members who are not attending, I’m going to blog as much as I can throughout the event. So check back for updates May 17-20.
