On Thursdays I cover a technology topic that affects the developer community, and today I am going to given an ActionCable overview, which is a new feature in Rails 5.
I attended RailsConf 2015, where DHH gave a high level view of Rails 5 and discussed how it’s going to help bridge the gap between classic style Rails apps and the new client side MVCs. As no big surprise, being the founder of the Ruby on Rails framework, DHH is not a fan of SPA type apps.
- Who: it was developed by the Rails open source community.
- What: it is a module in Rails 5 that leverages WebSockets to bring state to an application. This means that your users won’t have to change or refresh a page to get new data, it can be pushed to them from the application itself. Also note, it doesn’t require archaic forms of development, such as polling.
- When: it is available now, and will be officially released when Rails 5 is considered the stable version.
- Where: you can get it from the Rails github repository
- Why: this is important since users are now expecting to have the ability for applications to be more dynamic, having stateless apps aren’t good enough anymore, and a tool like ActionCable will let you deliver real time data and updates to users while still within the Rails framework ecosystem.
- How: ActionCable creates the concepts of Channels, where you can perform asynchronous data transfers, both requests and responses from within the application files.
I hope this was a helpful ActionCable overview for understanding what it is and how it can be helpful for your Rails applications, I’ll also include links to tutorials so you can try it out for yourself, and good luck with the coding!