我有一个带有嵌套参数的表单。在以下示例中,如何获取控制器中的“amount_whole”值?
Parameters: {"utf8"=>"✓", "authenticity_token"=>"KCmBI6RLh0LdUsM2r5H1vhNykS1IXecFe5Lct+TuIGc=", "dec_declaration"=>{"declaration_nr"=>"SAL_2012_0001", "dec_declarationlines_attributes"=>{"0"=>{"amount_whole"=>"75"}}
是这样吗?
amount = params[:dec_declarations][:dec_declarationlines_attributes][:amount_whole]