Sha256: f7620078655a41551232c19ac3843a7c8b09d164938a3a4a12de5493e345d779
Contents?: true
Size: 640 Bytes
Versions: 30
Compression:
Stored size: 640 Bytes
Contents
require 'rubygems' require 'ramaze' class MainController < Ramaze::Controller map '/' helper :cache def index @number = rand * 100 %q[ <html> <head><title>examples/caching</title></head> <body> <p> This action just shows you a random number: #{@number}.<br /> If you <a href="/">refresh</a> the page it won't change since you see a cached version.<br /> But if you <a href="/invalidate">invalidate</a> it, the page will be regenerated. </p> </body> </html> ] end cache_action :method => 'index' def invalidate Ramaze::Cache.action.delete('/') redirect :/ end end Ramaze.start
Version data entries
30 entries across 30 versions & 4 rubygems