Turbo Showcase

Streams

It's time to look at our first turbo-stream example.

We will use the Turbo::StreamsChannel API to show how this works rather than the Turbo::Broadcastable concern which adds a further layer of complexity to the whole story.

I have some content

The link below, will update the content above by using an ActionCable stream.

Check the implementation in the #refresh_stream_title action.

If you open multiple tabs, you will see that the content is replaced in all the tabs.

🤫 If the number is changing, it means that someone else is refreshing it right now.

Click me