module TurboStreamsTagBuilder
Ruby on Rails 1.4.0
Since v1.3.3 Last seen in v2.0.23Most turbo streams are rendered either asynchronously via Turbo::Broadcastable/Turbo::StreamsChannel or rendered in templates with the turbo_stream.erb extension. But it’s also possible to render updates inline in controllers, like so:
def destroy @user.destroy! respond_to do |format| format.turbo_stream { render turbo_stream: turbo_stream.remove(@user) } format.html { redirect_to users_url, notice: "User removed" } end end
This module adds that turbo_stream tag-builder object to all controllers. It’s an instance of Turbo::Streams::TagBuilder instantiated with the current view_context.