Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8791

Show
Ignore:
Timestamp:
02/03/08 01:11:42 (7 months ago)
Author:
bitsweat
Message:

Fix missing extension for caching. Closes #10733 [Catfish, tcoppock, mpalmer]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_view/base.rb

    r8689 r8791  
    159159     
    160160    attr_writer :template_format 
     161    attr_accessor :current_render_extension 
    161162 
    162163    # Specify trim mode for the ERB compiler. Defaults to '-'. 
     
    359360    def render_template(template_extension, template, file_path = nil, local_assigns = {}) #:nodoc: 
    360361      handler = self.class.handler_class_for_extension(template_extension).new(self) 
     362      @current_render_extension = template_extension 
    361363 
    362364      if handler.compilable? 
  • trunk/actionpack/lib/action_view/helpers/cache_helper.rb

    r8683 r8791  
    3333      #    <% end %> 
    3434      def cache(name = {}, options = nil, &block) 
    35         template_extension = @finder.pick_template_extension(first_render)[/\.?(\w+)$/, 1].to_sym 
    36         handler = Base.handler_class_for_extension(template_extension) 
     35        handler = Base.handler_class_for_extension(current_render_extension.to_sym) 
    3736        handler.new(@controller).cache_fragment(block, name, options) 
    3837      end