2013-12-18 38 views
0

升級到rails 4後update_attributes不再工作。它說在rails 4中更新屬性?

ArgumentError (argument out of range): 

代碼:

def terms_build_methods 
    if @lease.blank? 
    @lease = params[:current_lease_id].present? ? Lease.find_by_id(params[:current_lease_id].to_i) : Lease.create(params[:lease]) 
    else 
    @lease.update_attributes(params[:lease]) 
    end 
end 


params[:lease]: 

{"lease"=>{"property_lease_suite_attributes"=>{"tenant_attributes"=>{"tenant_legal_name"=>"OPTICACCESS LLC", "lease_contact_attributes"=>{"name"=>"dhhh", "email"=>"", "address"=>"abc", "phone"=>"hdfdf", "fax"=>"abc"}, "dba_name"=>"abc", "tax_id"=>"fdfdf", "landlord_attributes"=>{"landlord_legal_name"=>"", "name"=>"", "dba_name"=>"", "email"=>"", "address"=>"", "phone"=>"", "fax"=>"", "tax_id"=>""}, "billing_contact_name"=>"", "billing_contact_address"=>"", "notice_contact_name"=>"", "notice_contact_address"=>"", "sublease_or_assignee_contact_name"=>"", "sublease_or_assignee_contact_address"=>"", "note_attributes"=>{"content"=>""}, "info_attributes"=>{"info_type"=>"rrrrrrrr", "renewal"=>"Renewal", "id"=>"1440"}, "id"=>"8025"}, "id"=>"9128"}, "execution"=>"MM/DD/YYYY", "mtm"=>"false", "commencement"=>"05/01/2013", "rent_commencement"=>"MM/DD/YYYY", "expiration"=>"04/30/2018", "note_attributes"=>{"content"=>""}, "real_estate_property_id"=>"1452", "is_executed"=>"true", "is_archived"=>"false", "user_id"=>"61", "is_detailed_view"=>"true"}} 
+0

請貼滿堆棧跟蹤。 – DNNX

+0

檢查更新的問題。 – kannathasan

回答