I have a LiveComponent that I want to be easily portable to different views. It’s a modal pop-up for creating a new user.
Imagine you’re at accounts/:name
You click to open the “user-add” modal, which does a push_patch to accounts/:name/user-add
When done adding the user, you want it to push_patch back to accounts/:name
But say you want to have this component in accounts/:name/edit as well, and, similarly, when done adding the user, have it return from accounts/:name/edit/user-add back to accounts/:name/edit
I can do this by giving the component an assigns variable called @return_path or something like that, but I’m wondering if there is a way where you don’t explicitly have to set the assigns with this variable, and maybe the component can figure out from context which path it was called from and then just return to that path when closing.