We will be creating an application to track Professors and Students at the Hogwarts School of Witchcraft and Wizardry from the Harry Potter book series (you do not need any knowledge of Harry Potter to complete this challenge).
- Professors have a name, age, and specialty
- Students have a name and age
- Professors have many students
- Students have many professors
User Story 1
As a visitor,
When I visit a professor show page,
Then I see that professor's name, age, and specialty (e.g. "Name: Minerva McGonagall, Age: 204, Specialty: Transfiguration")
And I see the names of all students associated with this professor
User Story 2
As a visitor,
When I visit a professor show page,
Then I see the average age of all students associated with this professor
User Story 3
As a visitor,
When I visit the professor index,
I see the name of each professor,
And next to each professor I see a link to "Update"
When I click this link,
Then I am taken to a form where I can input a new name, age, and specialty
When I click the submit button,
Then I am taken back to the professors index where I see that professor has been updated
User Story Extension
As a visitor
When I visit the professor show page
Next to each students name I see a button "Unenroll"
When I click this button
Then I am taken back to the professor's show page
And I no longer see the student listed
(Note: You should not delete the student record entirely)