Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marcoroth/cable-streams-rails

Rails companion gem for the `cable-streams` NPM package
https://github.com/marcoroth/cable-streams-rails

cableready hotwire rails ruby turbo

Last synced: about 2 months ago
JSON representation

Rails companion gem for the `cable-streams` NPM package

Awesome Lists containing this project

README

        

## CableStreams Rails

This is a Rails helper gem for the [`cable-streams`](https://github.com/marcoroth/cable-streams) NPM package. CableStreams extends Turbo Streams with Custom Turbo Stream Actions and all CableReady operations.

### Installation

```bash
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](https://cableready.stimulusreflex.com/v/v5/reference/operations).

Here's an example of the `console_log` operation:

```html+erb
<%= turbo_stream.console_log(message: "hello world") %>
```

Which renders to:
```html


[
{ "message": "hello world", "operation": "consoleLog" }
]

```