From b16ebdb93d50574941320c53a779f4cd7dc2d92e Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Sat, 13 Jul 2024 07:55:02 +0200 Subject: [PATCH] Revert "Revert "Re-structure turbo-stream[action=morph] support"" --- _source/handbook/05_streams.md | 30 ++++++++++++------------ _source/reference/streams.md | 42 ++++++++++++++++------------------ 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/_source/handbook/05_streams.md b/_source/handbook/05_streams.md index 58807a3..f6ca391 100644 --- a/_source/handbook/05_streams.md +++ b/_source/handbook/05_streams.md @@ -38,6 +38,13 @@ A Turbo Streams message is a fragment of HTML consisting of `` ele + + + + + + @@ -73,22 +87,6 @@ A Turbo Streams message is a fragment of HTML consisting of `` ele - - - - - - - - ``` diff --git a/_source/reference/streams.md b/_source/reference/streams.md index b065a2b..f8aabda 100644 --- a/_source/reference/streams.md +++ b/_source/reference/streams.md @@ -46,6 +46,16 @@ Replaces the element designated by the target dom id. ``` +The `[method="morph"]` attribute can be added to the `turbo-stream` element to replace the element designated by the target dom id via morph. + +```html + + + +``` + ### Update Updates the content within the template tag to the container designated by the target dom id. @@ -58,6 +68,16 @@ Updates the content within the template tag to the container designated by the t ``` +The `[method="morph"]` attribute can be added to the `turbo-stream` element to morph only the children of the element designated by the target dom id. + +```html + + + +``` + ### Remove Removes the element designated by the target dom id. @@ -91,28 +111,6 @@ Inserts the content within the template tag after the element designated by the ``` -### Morph - -Replaces the element designated by the target dom id via morph. - -```html - - - -``` - -The `children-only` attribute can be added to the `turbo-stream` element to morph only the children of the element designated by the target dom id. - -```html - - - -``` - ### Refresh Initiates a [Page Refresh](/handbook/page_refreshes) to render new content with