I am using the decent_exposure gem and have run into a quandry.
I have a model Child that is a child of model Parent, but isn’t always called in the context of a Parent – the show method for instance would not be nested.
My Child’s controller exposes :parent as well as :children { parent.children } and this works when the index method is called in the context of a Parent but not when the child show method is called without a parental context.
How should this be handled?
I typically would do something like:
This works for the show, update and edit, delete since that would require the ID (/child/1), but the second half of the statement would allow you to also support your new and create.