Stream Comments with Rails 5 and ActionCable

Rails now comes with WebSockets built in!

David Hunt
When Code Explodes!
1 min readDec 28, 2015

--

Scenario

You have a personal blog application that allows readers to leave anonymous comments. You want the comments to appear dynamically. Luckily, Rails 5 Beta comes loaded with WebSockets.

This article assumes you have redis installed.

Conclusion

ActionCable is a really useful tool as WebSockets have grown in popularity and use cases. It makes sense for Rails to establish a convention for generating and using them within the framework. Thanks again to DHH for his work on the examples mentioned above.

Happy coding!

--

--