Loco is a framework (for a lack of better word ;) but… - it works on top of Rails. So it is rather a meta-framework or uber-framework - so to speak :)

Loco is made up of two cooperating parts. First part is a front-end MVC+ framework called Loco-JS. It provides structure for JavaScript assets, supplies base classes for models, controllers, views and can work autonomously.

Second part of Loco is a Rails Engine called Loco-Rails. It allows you to simply send notifications (emit signals) from any part of the system, directly to associated JavaScript models and all connected with them JavaScript objects (e.g. controllers, views). And you can do this basically in 1 line of code. For example:

emit article, :created, for: [Admin, article.user], data: {foo: ”bar”}

Then receivedSignal method for given connected JavaScript objects is called automatically. Everything is done under the hood via ajax polling by Loco framework. But Loco can also cooperate perfectly with ActionCable. Main repository contains a simple project which demonstrates that.


Besides that Loco-Rails repository contains decent-size demo app under test/dummy which shows different implementation strategies of many common features using Loco.

Also, according to this article https://dockyard.com/blog/2016/08/09/phoenix-channels-vs-rails-action-cable by Chris McCord - ActionCable has some performance issues so it is good to have a fallback which Loco ensures.

And all of that is just the top of an iceberg ;) Both projects have README pages that describe in great detail nearly all features of Loco.

Greetings from Cracow, Poland

Zbigniew Humeniuk hello@artofcode.co

Code Quality Rank: L5
Monthly Downloads: 438
Programming language: Ruby
License: MIT License

Loco-Rails alternatives and similar gems

Based on the "Frameworks" category

Do you think we are missing an alternative of Loco-Rails or a related project?

Add another 'Frameworks' Gem