Sha256: d26291db752f0af42d3be066c87f2d73ba123fc5a42e1ee558fc498815f7ee91
Contents?: true
Size: 630 Bytes
Versions: 7
Compression:
Stored size: 630 Bytes
Contents
require 'rubygems' require 'ramaze' class MainController < Ramaze::Controller map '/' helper :cache def index %[ <html> <head><title>examples/caching</title></head> <body> <p> This action just shows you a random number: #{rand * 100}.<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(:method => 'index') redirect :/ end end Ramaze.start
Version data entries
7 entries across 7 versions & 3 rubygems