However, it doesn’t work in certain scenarios. For example, I often find myself wanting to do something like this:
Which generates the following path:
It gets akward having to reference params[:product_legacy_id] in your controller, especially if you’ve standardized on variables like legacy_product_id (which reads and sounds better). So how do we specify the parameter in nested routes? We can choose to forego the resources helper:
But this gets tedious and is more error-prone. A better way - in my opinion - is to use nesting with the member helper.