2014-10-16 3 views
0

2 레벨 및 3 레벨 중첩 된 양식 속성을 업데이트 할 수 없습니다. 1 단계 속성을 업데이트 할 수 있지만 업데이트하지 않는 이유를 모르겠습니다. 아래 중첩 된 양식의 하위 요소를 업데이트 할 수 없습니다.

다음
def update 
    @buyer.update_attributes(params[:buyer]) 
    if params[:id].to_i != 0 
     redirect_to wizard_path(:buyer_posting_params) 
    else 
     render_wizard @buyer 
    end 
    end 

내 PARAMS 내 코드입니다

"구매자"=> { "buyer_forms_attributes"=> { "0"=> { "buyer_posting_params_attributes" = "{"id "=>"13 ", "_destroy "=>"false ","param_name "=>"11 ","param_type "=>"동적 ", "param_value " => "", "question_id"=> "17"}, "1"=> ​​{ "id"=> "14", "_destroy "=" "=" "false", "param_name"=> "22", "param_type"=> "dynamic", "param_value"=> "", "question_id"=> "2"}, "2"=> { " "id"=> "17", "_destroy"=> "false", "param_name"=> "33", "param_type"=> "static", "param_value"=> "test", "question_id" = ""id "=>"4 "}, "1 "=> {"buyer_posting_params_attributes "=> {"1413443012516 "=> {"_ 파괴 "=>"거짓 ", "param_name "= > "22", "param_type"=> "동적", "param_value"= "" " "question_id "=" "24"}}, "ID"=> "44"}}}

레일즈를 사용 중입니다.

다음과 같은 관계 :

One Buyer HasMany BuyerForms 
One BuyerForm HasMany BuyerPostingParams 

제발 도와주세요.

미리 감사드립니다.

답변