Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The wheels keep on spinning round, spinning round, spinning round

branch: master


latest commit 0cc84aaa30
Joe Ferris and Mike Burns authored August 03, 2012 jferris committed August 03, 2012
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore Remove log files August 03, 2012
Octocat-spinner-32 Gemfile Now it's a gem August 03, 2012
Octocat-spinner-32 LICENSE Now it's a gem August 03, 2012
Octocat-spinner-32 A little documentation August 03, 2012
Octocat-spinner-32 Rakefile Now it's a gem August 03, 2012
Octocat-spinner-32 turning.gemspec Update authors August 03, 2012


A tiny framework to render views whenever data changes rather than re-rendering on every visit.


Create a listener:

# app/listeners/products_listener.rb
class ProductsListener < Turning::Listener
  def listen
    Product.on(:save) do |product|
      render 'show', product_path(product), product: product

Whenever a Product is saved, it will render the app/views/products/show.html.erb view and save it in public/static. A Rack middleware is included and autoconfigured to serve static pages from that directory.


Add this line to your application's Gemfile:

gem 'turning'

And then execute:

$ bundle

Or install it yourself as:

$ gem install turning


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new pull request
Something went wrong with that request. Please try again.