Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (29 sloc) 1.003 kB
595f002 Now it's a gem
Joe Ferris and Mike Burns authored
1 # Turning
2
4626c59 A little documentation
Joe Ferris and Mike Burns authored
3 A tiny framework to render views whenever data changes rather than re-rendering on every visit.
4
5 ## Usage
6
7 Create a listener:
8
9 # app/listeners/products_listener.rb
10 class ProductsListener < Turning::Listener
11 def listen
12 Product.on(:save) do |product|
13 render 'show', product_path(product), product: product
14 end
15 end
16 end
17
18 Whenever a `Product` is saved, it will render the
19 `app/views/products/show.html.erb` view and save it in `public/static`. A Rack
20 middleware is included and autoconfigured to serve static pages from that
21 directory.
595f002 Now it's a gem
Joe Ferris and Mike Burns authored
22
23 ## Installation
24
25 Add this line to your application's Gemfile:
26
27 gem 'turning'
28
29 And then execute:
30
31 $ bundle
32
33 Or install it yourself as:
34
35 $ gem install turning
36
37 ## Contributing
38
39 1. Fork it
40 2. Create your feature branch (`git checkout -b my-new-feature`)
41 3. Commit your changes (`git commit -am 'Added some feature'`)
42 4. Push to the branch (`git push origin my-new-feature`)
4626c59 A little documentation
Joe Ferris and Mike Burns authored
43 5. Create new pull request
Something went wrong with that request. Please try again.