This project is archived and is in readonly mode.

#4468 ✓resolved
ximus

Action caching (blocker): undefined local variable or method `cache'

Reported by ximus | April 24th, 2010 @ 01:56 PM | in 3.0.2

There is a bug here:

body = controller.render_to_string(:text => cache, :layout => true) unless @cache_layout

(Line 136 of action_controller/caching/actions.rb)

There is no cache variable declared, perhaps variable body is desired...

Here is the function context:

def filter(controller)
  path_options = if @cache_path.respond_to?(:call)
    controller.instance_exec(controller, &@cache_path)
  else
    @cache_path
  end

  cache_path = ActionCachePath.new(controller, path_options || {})

  body = controller.read_fragment(cache_path.path, @store_options)

  unless body
    controller.action_has_layout = false unless @cache_layout
    yield
    controller.action_has_layout = true
    body = controller._save_fragment(cache_path.path, @store_options)
  end

  body = controller.render_to_string(:text => cache, :layout => true) unless @cache_layout

  controller.response_body = body
  controller.content_type = Mime[cache_path.extension || :html]
end

Here is the link to the current implementation in master:

current implementation

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages