On Martes, 9 de Marzo de 2010 10:23:53 Benjamin Adler escribió:
> On Tuesday 09 March 2010 09:56:45 Sergio Cambra .:: entreCables S.L. ::.
>
> wrote:
> > > But when I change the name of application 9 using the AS-interface, it
> > > goes and deletes *all* the application-associations from catalog_items
> > > that had application 9 associated. It doesn't stop there, it also
> > > deletes all reactivity-associations from the same CatalogItems.
> >
> > Try setting config.subform.columns with only a single column, without
> > associations, in CatalogItems controller
>
> Sergio, how exactly did this fix the problem?

I think I have guessed the problem:
plural associations may not actually appear in the params if all of the 
options have been unselected or cleared away, so we cleared plural 
associations if they aren't in the params and form_ui is set.

HABTM aren't shown in subforms even when form_ui is set. So excluding those 
associations from config.subform.columns fixes the problem.

If you don't want to update an association when editing the record in a 
subform (for example, you don't want update reactivities or applications in a 
catalog item when you updates an application), remove them from the subform 
columns:
# CatalogItemsController
config.subform.columns.exclude :reactivities, :applications

Anyway, I have removed exclussion of HABTM from subform, because :select UI 
works for HABTM in subforms now. If you update your AS copy those associations 
will be shown in the subform and they shouldn't be cleared.
-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to