This project is archived and is in readonly mode.
Passing a single object to a nested resource route generates confusing urls.
-
Vikrant Chaudhary
I expect
edit_author_book_path(book)to generate/authors/1/books/4/editbecause I guessbookalso carries an Author object viabook.author, so we shouldn't really be passing Author object anyways (or it should be optional at least). -
Andrew White
What's happening is that url generation is using the single argument as the :author_id and then getting the :id parameter from the existing url parameters. This is expected - the url generation code can't know that :id should be used as :author_id and the book argument should be :id.
-
DHH
- State changed from new to invalid