A student gets admitted to a school and in its admission form, I want the user to assign student his/her batch and grade as well. Batch has many grades and grade belongs to batch.
In this scenario, I've to create a student form where I need the user to select pre-created batch and grade for the student. How should I create a fields_for form to select batch and grade for the student?
The Requirement is, there should be a dropdown where the user can select a batch and then the selected batch's grade and assign it to the student after submitting the form. So the student can have his/her batch and grade. So i could achieve something like:
Grade.last.students
,
Student.last.grade.batch
,
Student.last.grade