Allow stream action to expand into multiple actions

e.g. by including 'onclick()' event handler
This commit is contained in:
2024-02-04 20:05:36 +01:00
parent e95448ce9f
commit 76aae56ed5
4 changed files with 53 additions and 4 deletions

View File

@@ -102,8 +102,10 @@ module ApplicationHelper
tag.tr tag.td t('.no_items'), colspan: 10, class: 'hint'
end
def turbo_stream_handler(partial)
"Turbo.renderStreamMessage('#{j(render partial: partial)}'); return false;"
def render_turbo_stream(partial, locals)
# TODO: extend with smth like "if outside of rendering, render; otherwise
# appendChild() template within current render"
"Turbo.renderStreamMessage('#{j(render partial: partial, locals: locals)}'); return false;"
end
private