Friday, November 03, 2006

Ruby on Rails again

Well well well.

It turns out my brush with Ruby on Rails last year wasn't the end of the story.

I need to put together some CRUD screens at work, and I thought of giving RoR another try.

If I remember correctly, I stopped at the bit where I had to get the connectivity to Oracle working. This time I did a bit more googling and found that a Ruby version of the OCI adapter had been made available since the last time. Installing this didn't take me very far; when I ran the scaffold generator it informed me that it couldn't find the 'Comic' generator ('Comics' being the sample table I created).

Yeah, I didn't expect it to be that easy. Anyway, I found that a decent server side Oracle installation would contain the OCI libraries and header files; I checked our project server, and sure enough, oci.h and oci.lib were there. Back to building the adapter from the sources.

Success. I was able to finally see some CRUD screens in action.

I am still not enamoured with RoR, though. The reason: I simply couldn't grok the bit of generated code in the controller class which prevents POSTs. Is it a DBC thing? Is it a static block as in Java? Do the commas mean something special? Do I really care?