aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-03-18 15:52:43 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-03-18 15:52:43 -0700
commit71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b (patch)
tree4e4a89ceca056d7ee4fcf329ecb56bbc0547d553 /actionpack/lib/action_controller
parent523d0f3700f5bb68cdd3d549eaad63d8a88c2aef (diff)
downloadrails-71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b.tar.gz
rails-71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b.tar.bz2
rails-71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b.zip
All tests pass without memoizing view_context
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/caching/fragments.rb19
-rw-r--r--actionpack/lib/action_controller/metal/renderers.rb2
2 files changed, 1 insertions, 20 deletions
diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb
index 8a10bdfe23..473a2fe214 100644
--- a/actionpack/lib/action_controller/caching/fragments.rb
+++ b/actionpack/lib/action_controller/caching/fragments.rb
@@ -34,25 +34,6 @@ module ActionController #:nodoc:
ActiveSupport::Cache.expand_cache_key(key.is_a?(Hash) ? url_for(key).split("://").last : key, :views)
end
- def fragment_for(name = {}, options = nil, &block) #:nodoc:
- if perform_caching
- if fragment_exist?(name, options)
- read_fragment(name, options)
- else
- # VIEW TODO: Make #capture usable outside of ERB
- # This dance is needed because Builder can't use capture
- buffer = view_context.output_buffer
- pos = buffer.length
- yield
- fragment = buffer.slice!(pos..-1)
- write_fragment(name, fragment, options)
- end
- else
- ret = yield
- ActiveSupport::SafeBuffer.new(ret) if ret.is_a?(String)
- end
- end
-
# Writes <tt>content</tt> to the location signified by <tt>key</tt> (see <tt>expire_fragment</tt> for acceptable formats)
def write_fragment(key, content, options = nil)
return content unless cache_configured?
diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb
index 08325b468c..d906e1fb5b 100644
--- a/actionpack/lib/action_controller/metal/renderers.rb
+++ b/actionpack/lib/action_controller/metal/renderers.rb
@@ -87,7 +87,7 @@ module ActionController
end
add :update do |proc, options|
- _evaluate_assigns(view_context)
+ view_context = self.view_context
generator = ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.new(view_context, &proc)
self.content_type = Mime::JS
self.response_body = generator.to_s