On Jueves, 29 de Julio de 2010 12:34:41 Balaji escribió:
> Hello Sergio
>
> I tried using send_form_on_update_column = true
> For instance i have 2 drop downs insurance company insurance type and
> product
>
> On choosing insurance company,  insurance types gets loaded and on
> choosing insurance types, related products gets loaded.
> Now i choose a insurance company, and a insurance type and a product.
> I have set send_form_on_update_column = true for insurance types.
> After choosing a product, i again change the insurance type....
> thought the product list is upated the previously chosen value is
> still present in the product list.
> It does not clean up the list before reloading the product.

select form_ui builds the list using options_for_association helper (which 
build a list with options_for_association_conditions), and adds current value. 
render_field action create a new model and fill with sent values, as you are 
sending all the form, chosen product is set in new record and is added to the 
select list.

>
> Is there something that i a missing.
>
> My order controller is as below
>     config.columns[:insurancecompany].form_ui = :select
>     config.columns[:insurancecompany].update_column =
> [:insurancetype]
>     config.columns[:insurancetype].form_ui = :select
>     config.columns[:insurancetype].update_column = :product
>     config.columns[:insurancetype].send_form_on_update_column = true
>     config.columns[:product].form_ui = :select
>

A workaround: add a before_filter to render_field action:
before_filter :remove_product, :only => :render_field
protected
def remove_product
  params[:record][:product] = nil
end

-- 
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