Active scaffold polymorphic model


I am trying to use active scaffold to build a polymorphic model .

I have a number of models that can be featured and I have a Feature
that belongs_to :item, :polymorphic => true

In my config.columns I include :item_type and item_id, I also added
:item_name to show the name of the record in the form.
In the form, when a type of model is selected I populate the select box
item_name with with the names of the relevant records with the id of
each as
the value. I set the id of the select box to item_id instead of
item_name as
I have figured out that item_id is ignored by ActiveScaffold in the
Can I turn this off so that it shows the id?

Params is now passed with :record => {:item_type => “SelectedType”,
=> id corresponding to the name chosen} which should correctly save the
record, however, the record is saved without the item_id. If I use the
before_create_save(record) and before_update_save(record) functions and
record.item_id = params[:record][:item_id] it works.

I have found in the documentation that only whitelisted fields are
however, I did include :item_id in the config.columns…

I would appreciate it if anyone can provide some insights as to why the
item_id isn’t saved correctly.