Categories
Updrift is the home of J. Wade Winningham. He helps make the web work.
A couple of Ruby on Rails v1.2 gotchas
I recently upgraded a few projects to Rails v.1.2 and had a couple of issues arise.
Disappearing objects when dropped using drag and drop in Safari
For one project I use the drag and drop re-ordering provided by the Scriptaculous library. Not sure what did it, possibly even a Safari update, but only in Safari, once you let go of a dragged object, that object would disappear. It would come back when you refreshed the page and would have successfully triggered its intended action.
I did update my javascript files upon upgrading to v.1.2.1, but had not upon the upgrade to v1.2.2 since I wasn’t aware of any changes. I think the release of Scriptaculous on its actual site is newer (v1.7 right now) than that included in Rails so I updated my scripts and that solved the problem.
Model attributes not in the database were inaccessible
I wasn’t able to figure this one out, but was able to get around it. I have a model which has some methods to send/receive messages to a device. I had a
attr_accessor :last_response
which is an attribute that’s not in the database. It was simple a place to temporarily store the full message of the last response for use later on in the code. After the upgrade to v1.2.1 things were fine. However after updating to v.1.2.2, I started getting “Method not defined” errors. It seems like other people have hit this one, too.
My solution was simply to remove the property and change it to @last_response which worked for my limited use of it.
I’m still scratching my head though, since similar attributes work fine in other classes. The problem class, however, is unique in that instead of having ActiveRecord:Base as its parent, the actual parent is a generic class whose parent is ActiveRecord:Base.
Vista Home Premium and a New Gaming PC
I couldn’t wait so I got all the bits and pieces for a new gaming PC and they all arrived the end of last week. It actually went together quicker than I thought it would, so I was left trying to decide if I wanted XP or Vista on it. Considering I have an MSDN subscription with Microsoft and have licenses for Vista already, I decided to download the latest ISO images and install the Home Premium version.
It seems fine now, but here are some of the issues I’ve run into:
Vista would not install on an unformatted disk
I kept getting an exception error when the installer was trying to load. Some research indicated that a lot of people have run into the same thing. In some cases it was a bad DVD or CD burn, but in others, the solution was to run through the Windows XP install far enough to format the hard drive. So after doing a base install of XP Home, I booted up with the Vista DVD I created and the installation process went through.
Video Drivers
nVidia’s drivers for Vista are still in beta, so I had to download those to get the full benefits of my new graphics card. It’s unknown whether or not the drivers will be out of beta when Vista hits the stores. I have seen what I’ll call weird video events when the screen switches modes for games and sometimes when launching apps, so it’s not quite finished baking yet.
I Allow…
Uggghhh. I’m already tired of getting asked to Deny/Allow any little thing that happens. I can understand it from a security standpoint, but having experienced similar permission prompts on Mac and Linux, Vista’s prompts seem excessive.
World of Warcraft Updates
I’ve been able to install a few games, Doom 3, Half-Life 2 Eps. 1 and World of Warcraft. All are working great. However, I did run into one issue patching World of Warcraft, but was able to quickly find a solution on their forums. One of the patches (not all of them) would bomb out at the end and not get applied. It made a change to the Start Menu links for the game which Vista did not like and since Vista didn’t prompt me to allow it, the patch would not install. The solution was to manually apply the patch by right clicking the patch executable and selecting “Run as administrator”.
Otherwise
Everything else seems to be fine but I’m not doing anything but playing games so far. This won’t be a development machine, but I can at least use it for IE7 testing since I still want to keep IE6 on my work notebook as long as possible for easier testing.
function MM_preloadImages
Does anyone else get depressed when they view source on a web page and find this function?
My reasons for holding off installing IE7
Microsoft has finally released Internet Explorer version 7 and while I’ve downloaded it, I’m not quite ready to go there. I suppose for now I’ll wait until my automatic update tells me I should.
I’ve read about toolbars not working and sites that use Ajax are slow. While I do think it’s strange that IE7 executes things slower than IE6, these aren’t really the issues that are preventing me from moving my IE7 install from a virtual machine over my primary IE6 install.
Here are my personal reasons for holding off
- I use FireFox. Aside from development, I haven’t used IE as my primary browser in years. I use IE strictly for developing websites.
- IE6 is not going away very soon and will continue to be more of a headache than IE7. IE7’s implementation of CSS has proved to be close enough to FireFox/Safari/Opera that I know I won’t spend much time on it. I’ll spend my time making things work in IE6. It’s just plain easier and faster to test in IE6 if it’s still the main IE on my machine.
- My clients and their users aren’t going to rush out to upgrade. While smaller clients may upgrade, larger ones won’t be in such a hurry.
- I cannot run IE6 and IE7 simultaneously on my machine without having one loaded in Virtual PC (or related virtual machine). I really think Microsoft makes things difficult for web developers by not making it straightforward to do this. Sure there are hacks to get them to both load, but I’ve tried these and just don’t trust them like I would a clean install.
Dvorak's bugged by CSS
I’m not a religious reader of John Dvorak. I don’t consider him a web developer, so when he posts articles like this one blaming the standards community for failing to do what it promised to do, I can’t help feeling that he’s misdirected. But is he?
The problems he mentions, mostly how instructions cascade, are nothing new to web developers who have been working with CSS for a while. I almost want to say he should be putting the blame on browsers, but that’s not his issue. The issue is that he’s new to CSS and I would bet that even if he were only using one browser, he’d still have his issues. I think if he thought of it more like applying styles in Word or something, he’d find it easier to understand.
Coincidentally, today Zeldman posted An Angry Fix which comments on recent departures from the W3C, which is supposed to be leading the CSS standards effort but is failing in some respects. I agree with him and hope the W3C can correct its course. The most interesting part was when Zeldman mentions that develpors may start looking elsewhere… Microformats.
And why not? Microformats adhere to standards, but they are higher level. Anyone able to understand XML data should be able to understand a microformat. And just as it takes someone with more knowledge to write an XSD template for an XML file, we’d expect someone with more knowledge to write a CSS file for a microformat. Maybe by adding a LayoutFormats or MacroFormats we’d eventually not have a use for the W3C. The key is for developers to contribute.
While I see the benefits of microformats, I haven’t been a big user of them. I’m definitely going to pay closer attention now.
Dish Networks, PLEASE stop calling me!
Every single day, one to three times, I get a call from Dish Networks trying to get me to switch. I hate them and am at the point where I want to retaliate.
[UPDATE: You can track my status with this here.]
Keep up with your Rails tests
I haven’t updated my progress on the project I’ve been working on in a while. This is somewhat due to simply getting caught up in the development of it. I’ve also been working the past few weeks on creating the CSS/HTML based on the delivered design. Here’s two things I’ve learned about my experience since last time…
Don’t forget about running your tests
While I think I did a good job creating unit tests, I definitely let my functional tests slide. I have also not been religiously running my existing tests, so it wasn’t much of a surprise that a number of them were failing when I ran them again recently. As I fix them up, I’ll be keeping track of where they would have helped me out.
One thing I do know is where I need to have functional tests. I’m not nearly as concerned with pages which do nothing but display information, mostly ones where it would change, or redirect you based on security.
IE7 is much easier to style than IE6, but still not quite as good
Okay, This isn’t really Ruby on Rails specific. This assumes you create styles like I do. Create your CSS to work in Firefox and Safari and then get it to work in IE. I did run into some IE7 weirdness, but overall, there will be far less tweaks with it than you’d have with IE6. I created separate stylesheets with IE6 and IE7 fixes and the IE7 one is roughly 80% smaller than the one for IE6.
Agile Web Development 2nd Edition
If you’ve got the first edition of this book or about to buy it to get yourself started with Ruby on Rails, don’t buy it. The 2nd edition is now available in a beta form and it’s well worth it. The most recent additions to Rails really the original print largely obsolete. Yes, that much has changed.




