Is there any way to open a modal Create form, enable the user to save (this all works), but then not close the modal and allow them to continue to work and have it update instead?
Obviously, right now, because the view is linked to the Create view/controller action, every time the save button is pressed it creates a new entry in the db. Is there a way to switch the controller action after the first use of the Save button?
Unless I’m misunderstanding your comment, I’m not looking to update the index. I want the modal window to perform the initial create action and then switch into update action for subsequent saves in the modal.
Basically, the user enters data in the modal and performs a save, initial commit to the db. The modal remains open and the user continues their entry and saves again, updating the record, … until which time they close the modal.
Right now, since they open the modal create view, every save creates a new record in the db. It switching the action from create to update that I’d need help with.
Would it be wrong to use the controller action to pass back (using JSON) the update route (Url::toRoute()) and then update the form action to this URL? I did a quick test and it seems to work. Just curious if this is an acceptable approach or if I should be doing things differently?