Open subdigital opened 7 years ago
I'm planning on implementing a "subresource" feature at some stage. However you are correct that this isn't currently handled properly, and something like you have is probably the best solution so far.
I appreciate the feedback! I know it's still pretty early, but I've enjoyed using Trestle so far. 👍
I needed a solution for subresources too and used return_to
for the redirects which really simplified the code above. For destroy e.g., the code was return_to(on: :destroy) { :back }
.
Commenting here in case someone needs it in the future.
I have a few nested resources (including a hierarchy of the same model) and I was wondering what the best approach for handling this is.
Currently I am overriding large parts of the controller to redirect to to the right place after certain actions (like delete, for instance) and to insert the parent record into the breadcrumb trail.
Here's an example:
I'm doing something similar in a few places and was wondering if there's a better way I'm missing, or if this isn't really handled properly yet.
Thanks!