I am trying to create a student that has many awards
So I have something like this in routes.rb:
resources :students, has_many => [:awards]
And I think this should make my link like this if I want to see the awards for a student:
localhost:3000/students/1/awards
But I am getting a route not found error.
What am I missing?
You don’t define the has_many in your routes file, its defined in your model:
When making nested routes, you form a block and nest the resources inside as above. You can also define additional routes: