0.0
No release in over a year
Extend Turbo Streams with Custom Turbo Stream Actions or CableReady operations
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 6.0.0
>= 5.0.0
>= 6.0.0
 Project Readme

CableStreams Rails

This is a Rails helper gem for the cable-streams NPM package. CableStreams extends Turbo Streams with Custom Turbo Stream Actions and all CableReady operations.

Installation

bundle add cable_streams

Using the Tag Helpers

The cable_streams gem ships view helpers for all CableReady operations. All options are identical to the regular CableReady operations.

Here's an example of the console_log operation:

<%= turbo_stream.console_log(message: "hello world") %>

Which renders to:

<turbo-stream action="consoleLog" target="body">
  <template>
    [
      { "message": "hello world", "operation": "consoleLog" }
    ]
  </template>
</turbo-stream>