Friday, August 22, 2008

map.resources + has_one + form_for = surprise, mofo!

If you've got a route like

map.resources :cars, :has_one => :driver


You're probably expecting to use form_for like this:

form_for([@car, @driver])


That won't work. It'll complain about not being able to find the function, 'car_drivers_path' instead of 'car_driver_path'

Fix:

form_for(@driver, :url => car_driver_path(@car))


Hopefully in Rails 2.1.1 this will be fixed using a different, less crazy syntax:

http://rails.lighthouseapp.com/projects/8994/tickets/461-fixed-polymorphic_url-to-be-able-to-handle-singleton-resources

That is all.

Friday, August 08, 2008

The Grind.

Back to working full time again. Let some bills pile up, and now it's time to ninja-fu my way out of them.

I'm angling for some more Rails-based jobs than ASP.NET jobs, which means a slight pay-hit until I can amass a treasure-trove of my RoR proficiencies.

Not that I don't have plenty already that many, but they're mostly firewalled / intranet style. Need some public, grade-A consumer-facing sites to make this happen.