rails (0.14.2), OSX, webrick (right now - lighttpd in production)
I''m trying to cache pages with different file extensions and am having
a heck of a time.
This controller does nothing but display @cache.data (which can be XML or HTML)
Here''s the controller:
class DisplayController < ApplicationController
caches_page :xml, :html
session :off
def xml
@cache = Cache.find(params[:id])
response.headers[''content-type''] =
@cache.browser_content_type
#cache_page @cache.data,
"/display/xml/#{@params[''id'']}.xml"
end
def html
@cache = Cache.find(params[:id])
response.headers[''content-type''] =
@cache.browser_content_type
#cache_page @cache.data,
"/display/html/#{@params[''id'']}.html"
end
end
If I uncomment the cache_page lines I get these errors:
NoMethodError in
Display#xml
undefined method `merge'' for /display/xml/1.xml
NoMethodError in
Display#html
undefined method `merge'' for /display/html/1.html
I need to set the file extension so that lighttpd sends out the
correct mime type.
Any ideas?