I wrote an application a year ago or so for my local SCA group, but I could not deploy it because of a difference of philosophy (the sys admin is a PHP guy). I have been tinkering with on and off to make it better. I went to send it out as a code sample and I can only find the initial application. The much improved application is floating around my house on a flash drive, and I’m sure I will find it once I am done refactoring the application.

Isn’t that the way it always works?

CloudCamp

December 31, 2008

I will be attending CloudCamp in Indianapolis on January 28th.  It looks interesting and it couldn’t be closer.

NetBeans and GitHub

December 31, 2008

I use NetBeans 6.1 as my IDE and I have been happy with it. Since I needed the lastest and greatest will_paginate gem I added gems.github.com to my remote sources and promptly forgot about it. The next time I tried to look at Ruby Gems via NetBeans, it would blow up at me and advise me to check my proxies. After poking around in my proxies, I knew it had to be because I had added github to my remote sources, but I couldn’t remember how. I retraced my steps and found how I added it. Further web searching found the flag to remove it, which was what I suspected.

If I do something once, there is a better than average chance that I won’t remember a couple weeks later what I did to get that why and I cannot be alone. So to help others–at the command line type:

gem souces -r http://gems.github.com

My boss wants my Rails tables to work like the ASP datagrid.

I started with the work at http://dev.nozav.org/rails_ajax_table.html but I wanted to use the will_paginate gem and I needed it search several tables.   Incorporated the ez_where plugin for the search.  It isn’t as pretty as I would like it, but that’s nothing a little CSS tweaking can’t fix.

I know there is now a jQuery grid that will probably fill the bill at http://github.com/scrubber/jquery_grid_for_rails/ and I may refactor the app later but I was mostly written at the time I found it.

I post a full example and a step by step description (with code) after the holidays.

Ruby can be too helpful

November 14, 2008

I migrated a production app from Rails 1.2.3 to Rails 2.1. Since I was in the process of adding features anyway, why not take a little time and upgrade the Rails version. I was not the original developer, but it was a fairly small app. How hard could it be? I took the deprecated methods out of the code, tested (both programmatically and manually) my new features and the changed code. Everything worked and I pushed my changes to production.

I get an email from the application owner, they cannot run reports anymore and a couple of her users can’t save their data. I opened the app and ran a report no problem, but there in the production log was render_text throwing errors. Apparently I hadn’t gotten all the deprecated methods. That was an easy fix, I changed them over to render :text =>, and committed it and scheduled a deploy.

The two users who couldn’t save data? Production log has a nil object as the culprit. Since I was populating a checkbox from another table, I was using has_and_belongs_to_many. I changed from check_box_tag to check_box and changed the function which was populating the checkbox choices. I was getting a lovely array with my new function, but the values weren’t saving to the cross reference table. To build my new function I had instantiated more objects in the controller, so I tried putting my original function back and now it isn’t nil (again). So I pushed that change out with the render_text change, and called one of the users to see if she was still having a problem. No, she says. Did I do something yesterday because she and the other user can save their data since yesterday. I rolled out my changes 10 minutes before I called her.

Ruby, I know you are flexible. But if you are going to help me, help me all the time. Don’t work, then not work, then work again.