If my model contains nested objects, what’s the right way to generate urls? For example, I have a wishlists, and wishitems. A wishitem belongs to a wishlist. My URLs should be formatted like this: “appname/wishlist/:id/wishitem/:id”, where the first :id is the id of the wishlist, and the second :id is the id of the wishitem.
How do I correctly specify a url of that type, whether for use in a form, or a redirect_to or a link_to call? Do I need to create named routes? And if I do, how do I distinguish between the first id and the second id, or does that happen automagically?