Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-yin committed Aug 1, 2024
1 parent 6c800ec commit 589dc54
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/source/turbo_stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ return turbo_stream.response([
])
```

## Morph Method

As for `update` and `replace` actions, we can set `[method="morph"]` to make it work.

```python
turbo_stream.update("target", content="some html", method="morph")
```

In Django template:

```html
{% load turbo_helper %}

{% turbo_stream "update" "target" method="morph" %}some html{% endturbo_stream %}
```

## Render from Django Template

`turbo_stream` can help us generate `turbo-stream` element in Django template.
Expand Down

0 comments on commit 589dc54

Please sign in to comment.