@routine = Routine.find(params[:id])
respond_to do |format|
format.turbo_stream do
render turbo_stream: turbo_stream.remove_all(@routine)
end
format.html { redirect_to routines_path }
end
// Console output
DOMException: Failed to execute 'querySelectorAll' on 'Document': '#<Routine:0x0000000144d6f958>' is not a valid selector.
at get targetElementsByQuery (http://localhost:3000/assets/application-esb-00291cc91fc91ec2365e55e77ee50f5725fda7f684dabce1c9176942cf33bde7.js:58784:45)
at get targetElements (http://localhost:3000/assets/application-esb-00291cc91fc91ec2365e55e77ee50f5725fda7f684dabce1c9176942cf33bde7.js:58732:21)
at HTMLElement.remove (http://localhost:3000/assets/application-esb-00291cc91fc91ec2365e55e77ee50f5725fda7f684dabce1c9176942cf33bde7.js:58667:12)
at Object.renderElement [as render] (http://localhost:3000/assets/application-esb-00291cc91fc91ec2365e55e77ee50f5725fda7f684dabce1c9176942cf33bde7.js:58684:24)
at http://localhost:3000/assets/application-esb-00291cc91fc91ec2365e55e77ee50f5725fda7f684dabce1c9176942cf33bde7.js:58700:31
at async HTMLElement.connectedCallback (http://localhost:3000/assets/application-esb-00291cc91fc91ec2365e55e77ee50f5725fda7f684dabce1c9176942cf33bde7.js:58688:9)
When deleting an entity using Turbo, the
remove_all
stream action is not properly returning the selector in the stream. Please see below.