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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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 @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?
This topic is locked and can not be replied to.