Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/marcoroth/cable-streams-rails
- Owner: marcoroth
- License: mit
- Created: 2022-04-12T01:28:35.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-18T21:13:41.000Z (almost 2 years ago)
- Last Synced: 2024-07-19T16:15:58.828Z (2 months ago)
- Topics: cableready, hotwire, rails, ruby, turbo
- Language: Ruby
- Homepage:
- Size: 5.86 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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" }
]
```