Forum: Ruby on Rails cache_page throwing "undefined method merge" error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
dfroese (Guest)
on 2005-11-12 12:50
(Received via mailing list)
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 (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, "/display/xml/#{@params['id']}.xml"

  def html
    @cache = Cache.find(params[:id])
    response.headers['content-type'] = @cache.browser_content_type
    #cache_page, "/display/html/#{@params['id']}.html"


If I uncomment the cache_page lines I get these errors:

NoMethodError in
undefined method `merge' for /display/xml/1.xml

  NoMethodError in
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?
This topic is locked and can not be replied to.