mardi 16 avril 2019

getting error while using nested form in rails

I am using nested form in rails , parameters are coming in console but not save into the database table error : Unpermitted parameter: shyain_rekis

is there mistake in aru_params ? if there then what is the mistake please help me

thank you

def aru_params
  params.require(:aru).permit(:shyain_rekis_attributes => [:id, :emp_type, :company_leaving_reason, :_destroy])
end

Parameters: {"shyain_rekis_attributes"=>{"1555403656594"=> {"shyain_rekis"=>{"emp_type"=>"abc",company_leaving_reason"=>""}, "_destroy"=>"false"}}

I want to resolve error and save data into database table of nested form

Aucun commentaire:

Enregistrer un commentaire