diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-07-15 14:41:38 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-15 14:43:52 -0500 |
commit | aca246ab25497bb6787d2e18680e9f73ad13d223 (patch) | |
tree | ad107ae39feb55960a4f6faf084b3ad8bc56cbec /actionpack/lib/action_view/template_handlers | |
parent | 4f72feb84c25b54f66c7192c788b7fd965f2d493 (diff) | |
download | rails-aca246ab25497bb6787d2e18680e9f73ad13d223.tar.gz rails-aca246ab25497bb6787d2e18680e9f73ad13d223.tar.bz2 rails-aca246ab25497bb6787d2e18680e9f73ad13d223.zip |
Get buffer for fragment cache from template's @output_buffer
Diffstat (limited to 'actionpack/lib/action_view/template_handlers')
-rw-r--r-- | actionpack/lib/action_view/template_handlers/builder.rb | 7 | ||||
-rw-r--r-- | actionpack/lib/action_view/template_handlers/erb.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_view/template_handlers/rjs.rb | 11 |
3 files changed, 1 insertions, 23 deletions
diff --git a/actionpack/lib/action_view/template_handlers/builder.rb b/actionpack/lib/action_view/template_handlers/builder.rb index cbe53e11d8..335ec1abb4 100644 --- a/actionpack/lib/action_view/template_handlers/builder.rb +++ b/actionpack/lib/action_view/template_handlers/builder.rb @@ -9,15 +9,10 @@ module ActionView # ActionMailer does not have a response "controller.respond_to?(:response) && controller.response.content_type ||= Mime::XML;" + "xml = ::Builder::XmlMarkup.new(:indent => 2);" + + "self.output_buffer = xml.target!;" + template.source + ";xml.target!;" end - - def cache_fragment(block, name = {}, options = nil) - @view.fragment_for(block, name, options) do - eval('xml.target!', block.binding) - end - end end end end diff --git a/actionpack/lib/action_view/template_handlers/erb.rb b/actionpack/lib/action_view/template_handlers/erb.rb index ac715e30c2..2f2febaa52 100644 --- a/actionpack/lib/action_view/template_handlers/erb.rb +++ b/actionpack/lib/action_view/template_handlers/erb.rb @@ -51,12 +51,6 @@ module ActionView src = ::ERB.new(template.source, nil, erb_trim_mode, '@output_buffer').src "__in_erb_template=true;#{src}" end - - def cache_fragment(block, name = {}, options = nil) #:nodoc: - @view.fragment_for(block, name, options) do - @view.response.template.output_buffer - end - end end end end diff --git a/actionpack/lib/action_view/template_handlers/rjs.rb b/actionpack/lib/action_view/template_handlers/rjs.rb index 3892bf1d6e..a700655c9a 100644 --- a/actionpack/lib/action_view/template_handlers/rjs.rb +++ b/actionpack/lib/action_view/template_handlers/rjs.rb @@ -7,17 +7,6 @@ module ActionView "controller.response.content_type ||= Mime::JS;" + "update_page do |page|;#{template.source}\nend" end - - def cache_fragment(block, name = {}, options = nil) #:nodoc: - @view.fragment_for(block, name, options) do - begin - debug_mode, ActionView::Base.debug_rjs = ActionView::Base.debug_rjs, false - eval('page.to_s', block.binding) - ensure - ActionView::Base.debug_rjs = debug_mode - end - end - end end end end |