When you're getting this error, one possibility is that you've created a select field for an association instead of the associated object's id. Example:
form.select :unit, Unit.for_select
will be expected to deliver a real Unit
object, whereas
form.select :unit_id, Unit.for_select
will make Rails typecast the String value from the select field to the unit's ID.
Posted by Dominik Schöler to makandra dev (2011-12-16 12:03)