From f46554770bc80ba66ed5defe0991e69ffa8f9d6d Mon Sep 17 00:00:00 2001 From: Dan Jacob Date: Mon, 6 Sep 2021 21:26:25 +0300 Subject: [PATCH] Update docs --- doc/source/main.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/source/main.rst b/doc/source/main.rst index 15d61df..2246ec1 100644 --- a/doc/source/main.rst +++ b/doc/source/main.rst @@ -81,16 +81,19 @@ To render plain strings: from turbo_response import TurboFrame, TurboStream, Action - # returns TurboStream("msg").replace.render("OK") + # returns + TurboStream(".msg", is_multiple=True).replace.render("OK") + # set action dynamically TurboStream("msg").action(Action.REPLACE).render("OK") - # returns TurboStream("msg").remove.render() - # returns OK TurboFrame("msg").render("OK") You can also render templates: @@ -99,6 +102,8 @@ You can also render templates: TurboStream("msg").replace.template("msg.html", {"msg": "hello"}).render() + TurboStream(".msg", is_multiple=True).replace.template("msg.html", {"msg": "hello"}).render() + TurboFrame("msg").template("msg.html", {"msg": "hello"}).render() You can also return an *HTTPResponse* subclass. The content type *text/html; turbo-stream;* will be added to turbo stream responses.