Sha256: 2b4127cd14101c5d39b9fe653d4add2a44e27c0032f0d0b9aa7cd105730cc29f
Contents?: true
Size: 591 Bytes
Versions: 21
Compression:
Stored size: 591 Bytes
Contents
require 'rubygems' require 'ramaze' class MainController < Ramaze::Controller map :/ helper :cache cache :index 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 def invalidate action_cache.delete '/index' redirect :/ end end Ramaze.start
Version data entries
21 entries across 21 versions & 5 rubygems