This might be a tough one
I have a site which is using a polymorphic comments model.
Lets say the first model is library, and the second is book
so we have, library/1/book/63/
how do I route it so comments are then library/1/book/63/comments/1 ?
Thanks,
Elliot
update: looking for code for routes.rb file
You just nest them:
It may be confusing, but the polymorphic aspect of the data model is independent of the routes.
To call them via named routes, for a comment you’ll need to provide a library and a book, even if it’s unambiguous.