More

Meta

Search

ruote on rails

Many people use Ruby on Rails to implement their front ends. The question “how do I integrate ruote into my Rails application?” comes up often.

Ruote-kit is often the answer, but not always since it brings some (few) dependencies.

Most of the time, people integrating ruote inside of Rails want a simple setup where the ruote worker sits in the Rails application (the worker thread lives next to the Rails server thread), but this doesn’t play well with all the Rails deployment options. If you have, let’s say, a Unicorn setup spawning 5 processes, you’ll end up with 5 ruote worker threads and you’ll need to use a multi-worker safe ruote storage (see configuration).

One has to decide whether he wants his ruote workers to run inside of the Rails application or outside, as standalone / daemon workers.

with ruote-kit

The ruote-kit README should help setting up ruote-kit (standalone or as a Rails add-on).

If it’s not clear enough, feel free to fire a question on the ruote mailing-list or fork the project and fix the README (send a pull request).

add ruote and its storage to your Gemfile

add a config/initializers/ruote.rb file

This sample initializer uses ruote-redis as the storage, references it via a RUOTE_STORAGE constant and places the ruote dashboard behind a RUOTE constant. If you deem it more elegant you can also place the dashboard behind a singleton like Ruote.dashboard.