fromRubyflow
1 day agoHow to elegantly update other UI when a Turbo Frame is updated
When a request comes from a Turbo Frame, detect the Turbo-Frame header or the Accept header for 'text/vnd.turbo-stream.html' and return a turbo-stream response that emits one or more <turbo-stream> actions. Emit a replace or update for the frame's id and additional turbo-stream actions targeting menu, counter, or sidebar elements so external UI updates occur alongside the frame update. For full page navigations, render the complete HTML with the same updated fragments so behavior remains consistent.