Skip to Main Content
Modern Front-End Development for Rails, 2nd Edition
book

Modern Front-End Development for Rails, 2nd Edition

by Noel Rappin
September 2022
Intermediate to advanced content levelIntermediate to advanced
410 pages
10h 7m
English
Pragmatic Bookshelf
Content preview from Modern Front-End Development for Rails, 2nd Edition

Stimulus and ActionCable

The Turbo ActionCable helpers are great, but they don’t cover every use case for ActionCable we might have. You may need to use ActionCable by using custom JavaScript on the client, either because there is an already existing endpoint or because your task doesn’t quite fit with the Turbo patterns. In this section, we’re going to use ActionCable to rebuild the “sold out” feature we previously built using polling in Chapter 8, Talking to the Server.

To use ActionCable directly, we need to create objects on the client and on the server. On the server, we have channels and connections. An ActionCable channel is roughly analogous to a Rails controller. The channel is where you put the code that responds to data the server ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern Front-End Development for Rails

Modern Front-End Development for Rails

Noel Rappin

Publisher Resources

ISBN: 9781680509977Errata Page