Photo by Umberto on Unsplash

WebSockets is a beautiful way to allow the client-server communication using a persistent bidirectional channel without the client having to poll the server.

In this article I’d like to explain how to get started with websocket in Ruby on Rails from a generic application. I wont’ dive into what is a Websocket or how to create a Rails project. I’ll just leave some links at the end of this article.

First of all, WebSocket in Rails are called ActionCable.

The problem: Tutorials from the official documentation or others like this one explain how to configure the server part and show the code to subscribe and communicate from a Javascript…

an abstract represesentation of data
an abstract represesentation of data
Photo by fabio on Unsplash

Context: a PHP server and a MySQL database. This is a very common setup. You’ve to create a PHP script that interact with that database, but you’ve no access to the server because only script from localhost works due to firewall security restriction for example.

Problem: To test your script you’ve to open a FTP client, upload the .php script to the server and test it. Every time the php file changes you’ve to repeat this procedure, not considering that make attempts in production is a very bad practice.

Solution: Docker can come to rescue as he let the developer…

Mattia Ducci

Computer science master degree, mobile and full-stack developer, research fellow in the field of accessibility at the University of The Studies of Turin..

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store