I have 2 tables: campus (has_one) and notification (belongs_to)
I want to setup my routes so the index url uses the following format: /campusname/notifications
=> campusname is an unique value
With the nested routes my url always has an id. /campus/:campu_id/notifications
Currently my routes.rb looks like this:
shallow do
resources :campus do
resources :notifications
end
end
How can I get rid of that id and use the campusname instead?
And more importantly how do I edit my controller to show the right notifications for every campus? Can somebody point me in the right direction?