This problem was solved by writing the form code correctly, as shown in @ sunny1304 comment bootstrap_form_for([@student,@guardian] . Therefore, if none of the existing answers worked for you, it could be a hint or something that you will help.
Thanks to other authors, as their answers helped other users who encountered a problem like me.
Mostafa hussein
source share